322 cout <<
" *** This NcVertex initialisation was invoked via the NcEvent ctor." << endl;
418 for (Int_t i=1; i<=ndevs; i++)
541 Set(stamp.GetDate(),stamp.GetTime(),0,kTRUE,0);
559 Set(stamp.GetDate(),stamp.GetTime(),0,kFALSE,0);
623 return (TTimeStamp)(*this);
692 beam->SetNameTitle(
"Beam",
"Beam and target specifications");
740 beam->SetNameTitle(
"Beam",
"Beam and target specifications");
744 Double_t px=p.
GetX(1,
"car");
745 Double_t py=p.
GetX(2,
"car");
746 Double_t pz=p.
GetX(3,
"car");
787 if (beam) val=int(beam->
GetSignal(
"Aproj"));
801 if (beam) val=int(beam->
GetSignal(
"Zproj"));
815 if (beam) val=beam->
GetSignal(
"Pnucproj");
829 if (beam) val=int(beam->
GetSignal(
"Idproj"));
855 beam->SetNameTitle(
"Beam",
"Beam and target specifications");
903 beam->SetNameTitle(
"Beam",
"Beam and target specifications");
907 Double_t px=p.
GetX(1,
"car");
908 Double_t py=p.
GetX(2,
"car");
909 Double_t pz=p.
GetX(3,
"car");
950 if (beam) val=int(beam->
GetSignal(
"Atarg"));
964 if (beam) val=int(beam->
GetSignal(
"Ztarg"));
978 if (beam) val=beam->
GetSignal(
"Pnuctarg");
992 if (beam) val=int(beam->
GetSignal(
"Idtarg"));
1004 const char* name=GetName();
1005 const char* title=GetTitle();
1006 cout <<
" *" << ClassName() <<
"::Data*";
1007 if (strlen(name)) cout <<
" Name : " << GetName();
1008 if (strlen(title)) cout <<
" Title : " << GetTitle();
1011 cout <<
" Run : " <<
fRun <<
" Event : " <<
fEvent
1054 cout <<
" *" << ClassName() <<
"::SetDetector* A detector structure is already present --> No action taken." << endl;
1060 cout <<
" *" << ClassName() <<
"::SetDetector* Internal storage already contains devices --> No action taken." << endl;
1148 ndevs=
fDetector->GetNdevices(classname,kTRUE,hits);
1161 if (dev->InheritsFrom(classname)) ndevs++;
1166 Int_t nh=hits->GetEntries();
1174 for (Int_t ih=0; ih<nh; ih++)
1176 TObject* obj=hits->At(ih);
1180 if (obj->InheritsFrom(
"NcSignal")) sx=(
NcSignal*)obj;
1185 if (!(dev->InheritsFrom(classname)))
continue;
1188 jdev=dev->GetUniqueID();
1191 for (Int_t idx=0; idx<idxmax; idx++)
1193 if (jdev==devids.At(idx))
1202 devids.AddAt(jdev,ndevs-1);
1237 if (d.InheritsFrom(
"NcDetector"))
1241 cout <<
" *" << ClassName() <<
"::AddDevice* A detector structure is already present --> No action taken." << endl;
1254 if (
fDevices && d.InheritsFrom(
"NcDetectorUnit"))
1256 cout <<
" *" << ClassName() <<
"::AddDevice* Storage of NcDetectorUnit not supported in backward compatibility mode." << endl;
1270 cout <<
" *" << ClassName() <<
"::AddDevice* Internal storage array created for backward compatibility." << endl;
1347 cout <<
" *" << ClassName() <<
"::SetDevCopy* Invalid argument : " << j << endl;
1352 cout <<
" *" << ClassName() <<
"::SetDevCopy* Storage already contained devices."
1353 <<
" ==> DevCopy mode not changed." << endl;
1400 Int_t ndevs=
fDevices->GetEntries();
1401 if (i<=0 || i>ndevs)
1403 cout <<
" *" << ClassName() <<
"::GetDevice* Invalid argument i : " << i
1404 <<
" ndevs = " << ndevs << endl;
1425 return fDetector->GetDevice(name,kTRUE);
1436 Int_t ndevs=
fDevices->GetEntries();
1437 for (Int_t i=0; i<ndevs; i++)
1443 if (s == name)
return dev;
1466 return fDetector->GetIdDevice(
id,kTRUE,devs);
1470 TObjArray* arr=devs;
1473 if (!arr ||
id<0)
return 0;
1476 for (Int_t i=0; i<arr->GetSize(); i++)
1478 TObject* obj=arr->At(i);
1480 if (obj->InheritsFrom(
"NcDevice")) dev=(
NcDevice*)obj;
1483 idx=dev->GetUniqueID();
1484 if (idx==
id)
return dev;
1505 return fDetector->GetIdDevice(
id,classname,kTRUE);
1511 if (classname==
"*") classname=
"NcDevice";
1514 for (Int_t i=0; i<
fDevices->GetEntries(); i++)
1519 idx=dev->GetUniqueID();
1520 if (idx==
id && dev->InheritsFrom(classname))
return dev;
1556 cout <<
" There are " << ndevs <<
" devices available." << endl;
1560 cout <<
" The following " << ndevs <<
" devices are available :" << endl;
1564 for (Int_t i=1; i<=ndevs; i++)
1569 const char* name=dev->GetName();
1570 cout <<
" Device number : " << i;
1571 cout <<
" Class : " << dev->ClassName() <<
" Id : " << dev->GetUniqueID();
1572 if (strlen(name)) cout <<
" Name : " << name;
1574 if (nh) cout <<
" Nhits : " << nh;
1576 if (nw) cout <<
" Nwaveforms : " << nw;
1578 if (ns) cout <<
" Nsamples : " << ns;
1586 cout <<
" No devices present for this event." << endl;
1610 fDetector->ShowDevices(classname,mode,header);
1616 if (classname==
"*") classname=
"NcDevice";
1621 if (!mode || !ndevs2)
1623 cout <<
" There are " << ndevs2 <<
" selected devices available." << endl;
1627 cout <<
" The following " << ndevs2 <<
" selected devices are available :" << endl;
1629 for (Int_t i=1; i<=ndevs; i++)
1634 if (dev->InheritsFrom(classname))
1636 const char* name=dev->GetName();
1637 cout <<
" Device number : " << i;
1638 cout <<
" Class : " << dev->ClassName() <<
" Id : " << dev->GetUniqueID();
1639 if (strlen(name)) cout <<
" Name : " << name;
1641 if (nh) cout <<
" Nhits : " << nh;
1643 if (nw) cout <<
" Nwaveforms : " << nw;
1652 cout <<
" No devices present for this event." << endl;
1680 TObjArray* devs=
fDetector->GetDevices(classname,1,devices);
1698 fDevs=
new TObjArray();
1703 for (Int_t idev=1; idev<=ndev; idev++)
1708 if (dev->InheritsFrom(classname))
1750 nhits=
fDetector->GetNhitsDevices(classname,kTRUE,kTRUE);
1756 if (classname==
"*") classname=
"NcDevice";
1759 nhits=hits.GetEntries();
1763TObjArray*
NcEvent::GetHits(TString classname,TObjArray* hits,TString name,Int_t mode,Int_t opt)
1807 arr=
fDetector->GetHitsDevices(classname,kTRUE,kTRUE,hits,name,mode,opt);
1813 if (classname==
"*") classname=
"NcDevice";
1821 TObjArray* selected=hits;
1822 if (!selected) selected=
fHits;
1823 TObjArray ahits(*selected);
1824 selector.
GetHits(*selected,name,mode,opt,&ahits);
1853 sx=
fDetector->GetIdHit(
id,classname,kTRUE,kTRUE);
1859 if (classname==
"*") classname=
"NcDevice";
1864 Int_t nhits=hits.GetEntries();
1866 if (!nhits)
return 0;
1869 for (Int_t i=0; i<nhits; i++)
1874 sid=sx->GetUniqueID();
1875 if (
id==sid)
return sx;
1901 if (classname==
"*") classname=
"NcDevice";
1915 fHits=
new TObjArray();
1919 for (Int_t idev=1; idev<=
fDevices->GetEntries(); idev++)
1924 if (!(dev->InheritsFrom(classname)))
continue;
1926 for (Int_t ih=1; ih<=dev->
GetNhits(); ih++)
1942TObjArray*
NcEvent::SortHits(TString classname,Int_t idx,Int_t mode,Int_t mcal,Int_t deadcheck,TObjArray* ordered)
1987 TObjArray* arr=
fDetector->SortHits(classname,kTRUE,kTRUE,idx,mode,mcal,deadcheck,ordered);
1993 if (classname==
"*") classname=
"NcDevice";
1995 if (ordered) ordered->Clear();
1997 if (idx<=0 || abs(mode)!=1)
return 0;
2003 TObjArray* arr=dev.
SortHits(idx,mode,&hits,mcal,deadcheck,ordered);
2005 if (ordered)
return 0;
2012 if (arr)
fHits=
new TObjArray(*arr);
2016TObjArray*
NcEvent::SortHits(TString classname,TString name,Int_t mode,Int_t mcal,Int_t deadcheck,TObjArray* ordered)
2061 TObjArray* arr=
fDetector->SortHits(classname,kTRUE,kTRUE,name,mode,mcal,deadcheck,ordered);
2067 if (classname==
"*") classname=
"NcDevice";
2069 if (ordered) ordered->Clear();
2071 if (abs(mode)!=1)
return 0;
2077 TObjArray* arr=dev.
SortHits(name,mode,&hits,mcal,deadcheck,ordered);
2079 if (ordered)
return 0;
2086 if (arr)
fHits=
new TObjArray(*arr);
2142Double_t
NcEvent::GetCVAL(TObjArray* hits,TString obsname,TString weightname,Int_t mode,Int_t type)
const
2164 cval=d.
GetCVAL(hits,obsname,weightname,mode,type);
2193 if (classname==
"*") classname=
"NcDevice";
2201 dev.
GetExtremes(vmin,vmax,idx,&hits,mode,deadcheck);
2227 if (classname==
"*") classname=
"NcDevice";
2233 dev.
GetExtremes(vmin,vmax,name,&hits,mode,deadcheck);
2275 if (classname==
"*") classname=
"NcDevice";
2330 if (classname==
"*") classname=
"NcDevice";
2366 if (classname==
"*") classname=
"NcDevice";
2371 fDetector->ShowHits(classname,kTRUE,kTRUE,mode,f,u);
2380 Int_t nhits=hits.GetEntries();
2382 cout <<
" *" << ClassName() <<
"::ShowHits* There are " << nhits
2383 <<
" hits recorded for device class " << classname << endl;
2385 if (!nhits || !mode)
return;
2388 for (Int_t i=0; i<hits.GetEntries(); i++)
2391 if (sx) sx->
Data(f,u);
2397 cout <<
" Device Position";
2403TObjArray*
NcEvent::SortDevices(TString classname,TString name,Int_t mode,Int_t mcal,Int_t deadcheck,TObjArray* ordered)
2444 if (classname==
"*") classname=
"NcDevice";
2446 if (ordered) ordered->Clear();
2449 SortHits(classname,name,mode,mcal,deadcheck,&hits);
2451 TObjArray* devs=
SortDevices(&hits,
"*",0,mcal,deadcheck,ordered);
2463TObjArray*
NcEvent::SortDevices(TString classname,Int_t idx,Int_t mode,Int_t mcal,Int_t deadcheck,TObjArray* ordered)
2504 if (ordered) ordered->Clear();
2506 if (classname==
"*") classname=
"NcDevice";
2509 SortHits(classname,idx,mode,mcal,deadcheck,&hits);
2511 TObjArray* devs=
SortDevices(&hits,0,0,mcal,deadcheck,ordered);
2523TObjArray*
NcEvent::SortDevices(TObjArray* hits,TString name,Int_t mode,Int_t mcal,Int_t deadcheck,TObjArray* ordered)
2581 if (!hits)
return 0;
2583 TObjArray* sorthits=
new TObjArray(*hits);
2585 if (mode) dev.
SortHits(name,mode,hits,mcal,deadcheck,sorthits);
2598 Int_t nhits=sorthits->GetEntries();
2600 for (Int_t ih=0; ih<nhits; ih++)
2606 for (Int_t
id=0;
id<arr->GetEntries();
id++)
2615 if (!exist) arr->Add(dx);
2688 if (!hits)
return 0;
2690 TObjArray* sorthits=
new TObjArray(*hits);
2692 if (mode) dev.
SortHits(idx,mode,hits,mcal,deadcheck,sorthits);
2705 Int_t nhits=sorthits->GetEntries();
2707 for (Int_t ih=0; ih<nhits; ih++)
2713 for (Int_t
id=0;
id<arr->GetEntries();
id++)
2722 if (!exist) arr->Add(dx);
2754 if (strlen(name)) evt->SetName(name);
Double_t GetX(Int_t i, TString f, TString u="rad")
void AddNamedSlot(TString s)
Creation and investigation of an NCFS generic detector structure.
virtual TObject * Clone(const char *name="") const
Signal (Hit) handling of a generic device.
NcPosition GetCOG(TObjArray *hits, Int_t pos=0, TString slotname="none", Int_t mode=0) const
Nc3Vector GetHitPath(TObjArray *hits, Int_t pos=0) const
virtual TObject * Clone(const char *name="") const
void DisplayHits(TString name, Float_t scale=-1, TObjArray *hits=0, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
Double_t GetCVAL(TObjArray *hits, TString obsname, TString weightname="none", Int_t mode=0, Int_t type=1) const
NcSignal * GetHit(Int_t j) const
void GetExtremes(Float_t &vmin, Float_t &vmax, Int_t idx=1, TObjArray *hits=0, Int_t mode=1, Int_t deadcheck=1) const
TObjArray * SortHits(TString name, Int_t mode=-1, TObjArray *hits=0, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
Creation and investigation of an NCFS generic event structure.
NcPosition GetCOG(TObjArray *hits, Int_t pos=0, TString slotname="none", Int_t mode=0) const
Int_t GetProjectileId() const
TObjArray * fDevs
! Temp. array to hold references to user selected devices
NcDevice * GetIdDevice(Int_t id, TObjArray *devs=0) const
TObjArray * SortDevices(TString classname, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
TObjArray * SortHits(TString classname, TString name, Int_t mode=-1, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
void SetProjectile(Int_t a, Int_t z, Double_t pnuc, Int_t id=0)
Double_t GetTargetPnuc() const
void AddDevice(NcDevice &d)
void LoadHits(TString classname, TObjArray *hits=0)
TObject * fDisplay
! Temp. pointer to hold objects which serve event displays
Int_t GetEventNumber() const
void GetExtremes(TString classname, Float_t &vmin, Float_t &vmax, Int_t idx=1, Int_t mode=1, Int_t deadcheck=1)
TObjArray * fHits
! Temp. array to hold references to the registered NcDevice hits
void SetEventNumber(Int_t evt)
Int_t GetRunNumber() const
Double_t GetWeight() const
virtual TObject * Clone(const char *name="") const
void RemoveDevice(NcDevice *d)
void ShowDevices(Int_t mode=1, Bool_t header=kTRUE) const
NcDetector * GetDetector() const
virtual void HeaderData()
Int_t GetSelectLevel() const
virtual void Data(TString f="car", TString u="rad")
void SetSelectLevel(Int_t level)
void SetDayTime(TTimeStamp &stamp)
Double_t GetCVAL(TObjArray *hits, TString obsname, TString weightname="none", Int_t mode=0, Int_t type=1) const
void SetTarget(Int_t a, Int_t z, Double_t pnuc, Int_t id=0)
Int_t GetProjectileA() const
TObjArray * fOrdered
! Temp. array to hold references to various ordered objects
Int_t GetProjectileZ() const
NcSignal * GetIdHit(Int_t id, TString classname)
Int_t GetNdevices() const
NcDevice * GetDevice(Int_t i) const
void DisplayHits(TString classname, TString name, Float_t scale=-1, Int_t dp=0, Int_t mode=1, Int_t mcol=4)
void SetWeight(Double_t weight)
Int_t GetNhits(TString classname)
TObjArray * GetDevices(TString classname, TObjArray *devices=0)
TTimeStamp GetDayTime() const
void SetDetector(NcDetector d)
virtual void SetOwner(Bool_t own=kTRUE)
Double_t GetProjectilePnuc() const
Int_t GetTargetId() const
void SetRunNumber(Int_t run)
TObjArray * GetHits(TString classname, TObjArray *hits=0, TString name="none", Int_t mode=0, Int_t opt=0)
void ShowHits(TString classname, Int_t mode=1, TString f="car", TString u="rad")
Nc3Vector GetHitPath(TObjArray *hits, Int_t pos=0) const
void ShowTracks(Int_t mode=1, TString f="car", TString u="rad", TObjArray *tracks=0)
void GetPosition(Double_t *r, TString f, TString u="rad", Float_t s=-1) const
virtual void Data(TString f="car", TString u="rad") const
Generic handling of (extrapolated) detector signals.
Int_t GetNwaveforms() const
virtual void SetSignal(Double_t sig, Int_t j=1)
NcDevice * GetDevice() const
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Int_t GetNsamples() const
virtual void Data(TString f="car", TString u="rad") const
void Date(Int_t mode=3, Double_t offset=0)
virtual void Data(TString f="car", TString u="rad")
virtual void SetOwner(Bool_t own=kTRUE)