NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcSignal.cxx
Go to the documentation of this file.
1
30 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
31
32///////////////////////////////////////////////////////////////////////////
33
147
148#include "NcSignal.h"
149#include "NcTrack.h"
150#include "Riostream.h"
151
152ClassImp(NcSignal); // Class implementation to enable ROOT I/O
153
155NcSignal::NcSignal(const char* name,const char* title) : TNamed(name,title),NcPosition(),NcAttrib()
156{
165
166 fSignals=0;
167 fDsignals=0;
168 fSigflags=0;
169 fWaveforms=0;
170 fSamples=0;
171 fLinks=0;
172 fDevice=0;
173 fTracks=0;
174 fDevset=kFALSE;
175}
176
178{
184
185 if (fLinks)
186 {
187 // Remove this signal from all related devices
188 TArrayI js;
189 TArrayI ks;
190 Int_t nlinks=GetIndices(0,js,ks);
191 Int_t j=0;
192 Int_t k=0;
193 for (Int_t il=0; il<nlinks; il++)
194 {
195 j=js.At(il);
196 k=ks.At(il);
197 TObject* obj=GetLink(j,k);
198 if (!obj) continue;
199 if (obj->InheritsFrom("NcDevice"))
200 {
201 NcDevice* dx=(NcDevice*)obj;
202 dx->RemoveHit(this);
203 }
204 }
205 delete fLinks;
206 fLinks=0;
207 }
208 if (fSignals)
209 {
210 delete fSignals;
211 fSignals=0;
212 }
213 if (fDsignals)
214 {
215 delete fDsignals;
216 fDsignals=0;
217 }
218 if (fSigflags)
219 {
220 delete fSigflags;
221 fSigflags=0;
222 }
223 if (fWaveforms)
224 {
225 delete fWaveforms;
226 fWaveforms=0;
227 }
228 if (fSamples)
229 {
230 delete fSamples;
231 fSamples=0;
232 }
233 if (fTracks)
234 {
235 // Remove this signal from all related tracks
236 for (Int_t i=1; i<=GetNtracks(); i++)
237 {
238 NcTrack* tx=GetTrack(i);
239 if (tx) tx->RemoveSignal(*this,0);
240 }
241 delete fTracks;
242 fTracks=0;
243 }
244}
245
247{
253
254 fSignals=0;
255 fDsignals=0;
256 fSigflags=0;
257 fWaveforms=0;
258 fSamples=0;
259 fLinks=0;
260 fTracks=0;
261
262 fDevset=kFALSE;
263
264 // Don't copy the owning device pointer for the copy
265 fDevice=0;
266
267 Int_t n=s.GetNvalues();
268 Double_t val;
269 Int_t lock;
270 for (Int_t i=1; i<=n; i++)
271 {
272 if (s.GetSignalFlag(i))
273 {
274 val=s.GetSignal(i);
275 lock=s.GetLockValue();
276 if (lock) Unlock();
277 SetSignal(val,i);
278 if (lock) Lock();
279 }
280 }
281
282 n=s.GetNerrors();
283 for (Int_t j=1; j<=n; j++)
284 {
285 if (s.GetErrorFlag(j))
286 {
287 val=s.GetSignalError(j);
288 lock=s.GetLockValue();
289 if (lock) Unlock();
290 SetSignalError(val,j);
291 if (lock) Lock();
292 }
293 }
294
295 n=s.GetNwaveforms();
296 for (Int_t k=1; k<=n; k++)
297 {
298 TH1F* hist=s.GetWaveform(k);
299 if (hist) SetWaveform(hist,k);
300 }
301
302 n=s.GetNsamples();
303 for (Int_t m=1; m<=n; m++)
304 {
305 NcSample* sample=s.GetSample(m);
306 if (sample) SetSample(sample,m);
307 }
308
309 TArrayI slotarr;
310 TArrayI posarr;
311 TObject* dum=0;
312 n=s.GetIndices(dum,slotarr,posarr);
313 Int_t slot,pos;
314 for (Int_t idx=0; idx<n; idx++)
315 {
316 slot=slotarr.At(idx);
317 pos=posarr.At(idx);
318 TObject* obj=s.GetLink(slot,pos);
319 if (obj) SetLink(obj,slot,pos);
320 }
321
322 Int_t ntk=s.GetNtracks();
323 if (ntk)
324 {
325 fTracks=new TObjArray(ntk);
326 for (Int_t it=1; it<=ntk; it++)
327 {
328 NcTrack* tx=s.GetTrack(it);
329 fTracks->Add(tx);
330 }
331 }
332}
333
334void NcSignal::Reset(Int_t mode)
335{
368
369 if (mode<0 || mode>1)
370 {
371 cout << " *NcSignal::Reset* Invalid argument mode = " << mode << endl;
372 cout << " Default mode=0 will be used." << endl;
373 mode=0;
374 }
375
377 if (!mode)
378 {
379 ResetSignals();
380 }
381 else
382 {
385 }
386
387 if (fLinks) fLinks->Reset();
388
389 if (fTracks)
390 {
391 delete fTracks;
392 fTracks=0;
393 }
394}
395
397{
411
412 if (abs(mode)>2)
413 {
414 cout << " *NcSignal::ResetSignals* Invalid argument mode = " << mode << endl;
415 cout << " Default mode=0 will be used." << endl;
416 mode=0;
417 }
418
419 Int_t sflag=0;
420 Int_t eflag=0;
421
422 if (fSignals && (abs(mode)==0 || abs(mode)==1))
423 {
424 for (Int_t i=1; i<=fSignals->GetSize(); i++)
425 {
426 fSignals->AddAt(0,i-1);
427 eflag=GetErrorFlag(i);
428 SetSigFlags(0,eflag,i);
429 }
430 }
431
432 if (fDsignals && (abs(mode)==0 || abs(mode)==2))
433 {
434 for (Int_t j=1; j<=fDsignals->GetSize(); j++)
435 {
436 fDsignals->AddAt(0,j-1);
437 sflag=GetSignalFlag(j);
438 SetSigFlags(sflag,0,j);
439 }
440 }
441
442 if (mode>=0)
443 {
444 ResetWaveform(0);
445 ResetSample(0);
446 }
447}
448
450{
464
465 if (abs(mode)>2)
466 {
467 cout << " *NcSignal::DeleteSignals* Invalid argument mode = " << mode << endl;
468 cout << " Default mode=0 will be used." << endl;
469 mode=0;
470 }
471
472 if (fSignals && (abs(mode)==0 || abs(mode)==1))
473 {
474 delete fSignals;
475 fSignals=0;
476 }
477
478 if (fDsignals && (abs(mode)==0 || abs(mode)==2))
479 {
480 delete fDsignals;
481 fDsignals=0;
482 }
483
484 Int_t sflag=0;
485 Int_t eflag=0;
486
487 if (mode==0)
488 {
489 delete fSigflags;
490 fSigflags=0;
491 }
492 else if (abs(mode)==1)
493 {
494 for (Int_t i=1; i<=fSigflags->GetSize(); i++)
495 {
496 eflag=GetErrorFlag(i);
497 SetSigFlags(0,eflag,i);
498 }
499 }
500 else if (abs(mode)==2)
501 {
502 for (Int_t j=1; j<=fSigflags->GetSize(); j++)
503 {
504 sflag=GetSignalFlag(j);
505 SetSigFlags(sflag,0,j);
506 }
507 }
508
509 if (mode>=0)
510 {
512 DeleteSample(0);
513 }
514}
515
516void NcSignal::SetSignal(Double_t sig,Int_t j)
517{
533
534 if (GetLockValue(j)) return;
535
536 if (!fSignals)
537 {
538 fSignals=new TArrayF(j);
539 ResetSignals(-1);
540 }
541
542 Int_t size=fSignals->GetSize();
543
544 if (j>size)
545 {
546 fSignals->Set(j);
547 }
548
549 fSignals->AddAt(float(sig),j-1);
550
551 Int_t eflag=GetErrorFlag(j);
552 SetSigFlags(1,eflag,j);
553}
554
555void NcSignal::SetSignal(Double_t sig,TString name)
556{
575
576 Int_t j=GetSlotIndex(name);
577 if (j>0)
578 {
579 if (!GetLockValue(j)) SetSignal(sig,j);
580 }
581}
582
583void NcSignal::AddSignal(Double_t sig,Int_t j)
584{
600
601 if (GetLockValue(j)) return;
602
603 if (!fSignals)
604 {
605 fSignals=new TArrayF(j);
606 ResetSignals(1);
607 }
608
609 Int_t size=fSignals->GetSize();
610
611 if (j>size)
612 {
613 fSignals->Set(j);
614 }
615
616 Float_t sum=(fSignals->At(j-1))+sig;
617 fSignals->AddAt(sum,j-1);
618
619 Int_t eflag=GetErrorFlag(j);
620 SetSigFlags(1,eflag,j);
621}
622
623void NcSignal::AddSignal(Double_t sig,TString name)
624{
643
644 Int_t j=GetSlotIndex(name);
645 if (j>0)
646 {
647 if (!GetLockValue(j)) AddSignal(sig,j);
648 }
649}
650
651
651Float_t NcSignal::GetSignal(Int_t j,Int_t mode) const
652{
710
711 if (abs(mode)>8) return 0;
712
713 Int_t jcal=j;
714 Float_t sig=0;
715 Float_t gain=1;
716 Float_t offset=0;
717
718 // Get the corresponding slot index (and dead flag) of the parent device
719 Int_t pj=0;
720 Int_t pdead=0;
721 NcSignal* parent=(NcSignal*)GetDevice();
722 if ((abs(mode)==2 || abs(mode)>=4) && parent)
723 {
724 TString name=GetSlotName(j);
725 if (strlen(name.Data())) pj=parent->GetSlotIndex(name);
726 if (abs(mode)==8 && pj) pdead=parent->GetDeadValue(pj);
727 }
728 if (mode==8) mode=7;
729 if (mode==-8) mode=-7;
730
731 NcSignal* sx=(NcSignal*)this;
732
733 TF1* f=0;
734 if (mode==7)
735 {
736 f=sx->GetCalFunction(jcal);
737 if (f)
738 {
739 mode=3;
740 }
741 else
742 {
743 mode=4;
744 }
745 }
746 if (mode==-7)
747 {
748 f=sx->GetDecalFunction(jcal);
749 if (f)
750 {
751 mode=-3;
752 }
753 else
754 {
755 mode=-4;
756 }
757 }
758
759 if (abs(mode)==2 || abs(mode)>=4)
760 {
761 sx=(NcSignal*)GetDevice();
762 if (pj) jcal=pj;
763 }
764 if (!sx && abs(mode)>=5) sx=(NcSignal*)this;
765 if (mode==5) mode=2;
766 if (mode==-5) mode=-2;
767 if (mode==6) mode=3;
768 if (mode==-6) mode=-3;
769
770 if (fSignals)
771 {
772 if (j>0 && j<=(fSignals->GetSize()))
773 {
774 sig=fSignals->At(j-1);
775
776 if (mode==0 || !sx) return sig;
777
778 // Check for the dead flag setting
779 if (sx->GetDeadValue(jcal) || pdead) return 0;
780
781 // (De)correct the signal for the gain and offset
782 if (abs(mode)==1 || abs(mode)==2)
783 {
784 if (sx->GetGainFlag(jcal)) gain=sx->GetGain(jcal);
785 if (sx->GetOffsetFlag(jcal)) offset=sx->GetOffset(jcal);
786
787 if (fabs(gain)>0.)
788 {
789 if (mode>0) sig=(sig/gain)-offset; // Gain and offset correction
790 if (mode<0) sig=(sig+offset)*gain; // Gain and offset de-correction
791 }
792 else
793 {
794 sig=0;
795 }
796 return sig;
797 }
798
799 // (De)calibrate the signal with the corresponding (de)calibration function
800 if (abs(mode)==3 || abs(mode)==4)
801 {
802 f=sx->GetCalFunction(jcal);
803 if (mode<0) f=sx->GetDecalFunction(jcal);
804 if (f) sig=f->Eval(sig);
805 return sig;
806 }
807 }
808 else
809 {
810 cout << " *NcSignal::GetSignal* Index j = " << j << " invalid." << endl;
811 }
812 }
813 return sig;
814}
815
816Float_t NcSignal::GetSignal(TString name,Int_t mode) const
817{
836
837 if (!fSignals) return 0;
838
839 Int_t j=GetSlotIndex(name);
840 Float_t val=0;
841 if (j>0 && j<=(fSignals->GetSize())) val=GetSignal(j,mode);
842 return val;
843}
844
845void NcSignal::SetSignalError(Double_t dsig,Int_t j)
846{
862
863 if (GetLockValue(j)) return;
864
865 if (!fDsignals)
866 {
867 fDsignals=new TArrayF(j);
868 ResetSignals(-2);
869 }
870
871 Int_t size=fDsignals->GetSize();
872
873 if (j>size)
874 {
875 fDsignals->Set(j);
876 }
877
878 fDsignals->AddAt(float(dsig),j-1);
879
880 Int_t sflag=GetSignalFlag(j);
881 SetSigFlags(sflag,1,j);
882}
883
884void NcSignal::SetSignalError(Double_t dsig,TString name)
885{
904
905 Int_t j=GetSlotIndex(name);
906 if (j>0)
907 {
908 if (!GetLockValue(j)) SetSignalError(dsig,j);
909 }
910}
911
912Float_t NcSignal::GetSignalError(Int_t j) const
913{
921
922 Float_t err=0;
923 if (fDsignals)
924 {
925 if (j>0 && j<=(fDsignals->GetSize()))
926 {
927 err=fDsignals->At(j-1);
928 }
929 else
930 {
931 cout << " *NcSignal::GetSignalError* Index j = " << j << " invalid." << endl;
932 }
933 }
934 return err;
935}
936
937Float_t NcSignal::GetSignalError(TString name) const
938{
950
951 if (!fDsignals) return 0;
952
953 Int_t j=GetSlotIndex(name);
954 Float_t val=0;
955 if (j>0 && j<=(fDsignals->GetSize())) val=GetSignalError(j);
956 return val;
957}
958
959void NcSignal::Data(TString f,TString u) const
960{
978
979 const char* name=GetName();
980 const char* title=GetTitle();
981
982 cout << " *" << ClassName() << "::Data* Id : " << GetUniqueID();
983 if (strlen(name)) cout << " Name : " << name;
984 if (strlen(title)) cout << " Title : " << title;
985 cout << endl;
986 if (fNv)
987 {
988 cout << " Position";
989 NcPosition::Data(f,u);
990 }
991 if (fDevice)
992 {
993 const char* devname=fDevice->GetName();
994 const char* devtitle=fDevice->GetTitle();
995 cout << " Owned by device : " << fDevice->ClassName() << " Id : " << fDevice->GetUniqueID();
996 if (strlen(devname)) cout << " Name : " << devname;
997 if (strlen(devtitle)) cout << " Title : " << devtitle;
998 cout << endl;
999 }
1000
1001 // Provide an overview of the stored waveforms
1002 ListWaveform(-1);
1003
1004 // Provide an overview of the stored samples
1005 ListSample(-1);
1006
1007 // Provide an overview of the associated tracks
1008 ListTrack(-1);
1009
1010 // Provide an overview of all the data and attribute slots
1011 List(-1);
1012}
1013
1014void NcSignal::List(Int_t j) const
1015{
1025
1026 if (j<-1)
1027 {
1028 cout << " *NcSignal::List* Invalid argument j = " << j << endl;
1029 return;
1030 }
1031
1032 if (j != -1)
1033 {
1034 const char* name=GetName();
1035 const char* title=GetTitle();
1036
1037 cout << " *" << ClassName() << "::Data* Id : " << GetUniqueID();
1038 if (strlen(name)) cout << " Name : " << name;
1039 if (strlen(title)) cout << " Title : " << title;
1040 cout << endl;
1041 if (fDevice)
1042 {
1043 const char* devname=fDevice->GetName();
1044 const char* devtitle=fDevice->GetTitle();
1045 cout << " Owned by device : " << fDevice->ClassName();
1046 if (strlen(devname)) cout << " Name : " << devname;
1047 if (strlen(devtitle)) cout << " Title : " << devtitle;
1048 cout << endl;
1049 }
1050 }
1051
1052 Int_t n=GetNslots();
1053 Int_t nlinkslots=0;
1054 if (GetNlinks()) nlinkslots=fLinks->GetMaxColumn();
1055 if (nlinkslots>n) n=nlinkslots;
1056
1057 TObject* obj=0;
1058 Int_t nrefs=0;
1059 TArrayI posarr;
1060 Int_t pos;
1061
1062 if (j<=0)
1063 {
1064 for (Int_t i=1; i<=n; i++)
1065 {
1066 obj=0;
1067 nrefs=GetIndices(obj,i,posarr);
1068
1069 if (GetSignalFlag(i) || GetErrorFlag(i) || GetCalFunction(i) || GetDecalFunction(i) || GetCalWord(i) || nrefs)
1070 {
1071 cout << " Slot : " << i;
1072 if (GetSignalFlag(i)) cout << " Signal value : " << GetSignal(i);
1073 if (GetErrorFlag(i)) cout << " error : " << GetSignalError(i);
1074 NcAttrib::List(i);
1075 cout << endl;
1076
1077 for (Int_t k=0; k<nrefs; k++)
1078 {
1079 pos=posarr.At(k);
1080 obj=GetLink(i,pos);
1081 if (obj)
1082 {
1083 cout << " Link at position " << pos << " to : " << obj->ClassName();
1084 if (obj->InheritsFrom("TNamed"))
1085 {
1086 const char* lname=obj->GetName();
1087 const char* ltitle=obj->GetTitle();
1088 if (strlen(lname)) cout << " Name : " << lname;
1089 if (strlen(ltitle)) cout << " Title : " << ltitle;
1090 }
1091 cout << endl;
1092 }
1093 }
1094 }
1095 }
1096 }
1097 else
1098 {
1099 if (j<=n)
1100 {
1101 obj=0;
1102 nrefs=GetIndices(obj,j,posarr);
1103
1104 if (GetSignalFlag(j) || GetErrorFlag(j) || GetCalFunction(j) || GetDecalFunction(j) || GetCalWord(j) || nrefs)
1105 {
1106 cout << " Slot : " << j;
1107 if (GetSignalFlag(j)) cout << " Signal value : " << GetSignal(j);
1108 if (GetErrorFlag(j)) cout << " error : " << GetSignalError(j);
1109 NcAttrib::List(j);
1110 cout << endl;
1111
1112 for (Int_t kj=0; kj<nrefs; kj++)
1113 {
1114 pos=posarr.At(kj);
1115 obj=GetLink(j,pos);
1116 if (obj)
1117 {
1118 cout << " Link at position " << pos << " to : " << obj->ClassName();
1119 if (obj->InheritsFrom("TNamed"))
1120 {
1121 const char* lnamej=obj->GetName();
1122 const char* ltitlej=obj->GetTitle();
1123 if (strlen(lnamej)) cout << " Name : " << lnamej;
1124 if (strlen(ltitlej)) cout << " Title : " << ltitlej;
1125 }
1126 cout << endl;
1127 }
1128 }
1129 }
1130 }
1131 }
1132}
1133
1134void NcSignal::List(TString name) const
1135{
1147
1148 Int_t j=GetSlotIndex(name);
1149 if (j>0) List(j);
1150}
1151
1152void NcSignal::ListWaveform(Int_t j) const
1153{
1163
1164 if (j<-1)
1165 {
1166 cout << " *NcSignal::ListWaveform* Invalid argument j = " << j << endl;
1167 return;
1168 }
1169
1170 if (j != -1)
1171 {
1172 const char* name=GetName();
1173 const char* title=GetTitle();
1174
1175 cout << " *" << ClassName() << "::Data* Id :" << GetUniqueID();
1176 if (strlen(name)) cout << " Name : " << name;
1177 if (strlen(title)) cout << " Title : " << title;
1178 cout << endl;
1179 if (fDevice)
1180 {
1181 const char* devname=fDevice->GetName();
1182 const char* devtitle=fDevice->GetTitle();
1183 cout << " Owned by device : " << fDevice->ClassName();
1184 if (strlen(devname)) cout << " Name : " << devname;
1185 if (strlen(devtitle)) cout << " Title : " << devtitle;
1186 cout << endl;
1187 }
1188 }
1189
1190 Int_t n=GetNwaveforms();
1191 TObject* obj=0;
1192
1193 if (j<=0)
1194 {
1195 for (Int_t i=1; i<=n; i++)
1196 {
1197 obj=GetWaveform(i);
1198 if (obj)
1199 {
1200 const char* wfname=obj->GetName();
1201 const char* wftitle=obj->GetTitle();
1202 cout << " Waveform " << i << " : " << obj->ClassName();
1203 if (strlen(wfname)) cout << " Name : " << wfname;
1204 if (strlen(wftitle)) cout << " Title : " << wftitle;
1205 cout << endl;
1206 }
1207 }
1208 }
1209 else
1210 {
1211 if (j<=n)
1212 {
1213 obj=GetWaveform(j);
1214 if (obj)
1215 {
1216 const char* wfnamej=obj->GetName();
1217 const char* wftitlej=obj->GetTitle();
1218 cout << " Waveform " << j << " : " << obj->ClassName();
1219 if (strlen(wfnamej)) cout << " Name : " << wfnamej;
1220 if (strlen(wftitlej)) cout << " Title : " << wftitlej;
1221 cout << endl;
1222 }
1223 }
1224 }
1225}
1226
1227void NcSignal::ListSample(Int_t j) const
1228{
1238
1239 if (j<-1)
1240 {
1241 cout << " *NcSignal::ListSample* Invalid argument j = " << j << endl;
1242 return;
1243 }
1244
1245 if (j != -1)
1246 {
1247 const char* name=GetName();
1248 const char* title=GetTitle();
1249
1250 cout << " *" << ClassName() << "::Data* Id :" << GetUniqueID();
1251 if (strlen(name)) cout << " Name : " << name;
1252 if (strlen(title)) cout << " Title : " << title;
1253 cout << endl;
1254 if (fDevice)
1255 {
1256 const char* devname=fDevice->GetName();
1257 const char* devtitle=fDevice->GetTitle();
1258 cout << " Owned by device : " << fDevice->ClassName();
1259 if (strlen(devname)) cout << " Name : " << devname;
1260 if (strlen(devtitle)) cout << " Title : " << devtitle;
1261 cout << endl;
1262 }
1263 }
1264
1265 Int_t n=GetNsamples();
1266 TObject* obj=0;
1267
1268 if (j<=0)
1269 {
1270 for (Int_t i=1; i<=n; i++)
1271 {
1272 obj=GetSample(i);
1273 if (obj)
1274 {
1275 const char* sname=obj->GetName();
1276 const char* stitle=obj->GetTitle();
1277 cout << " Sample " << i << " : " << obj->ClassName();
1278 if (strlen(sname)) cout << " Name : " << sname;
1279 if (strlen(stitle)) cout << " Title : " << stitle;
1280 cout << endl;
1281 }
1282 }
1283 }
1284 else
1285 {
1286 if (j<=n)
1287 {
1288 obj=GetSample(j);
1289 if (obj)
1290 {
1291 const char* snamej=obj->GetName();
1292 const char* stitlej=obj->GetTitle();
1293 cout << " Sample " << j << " : " << obj->ClassName();
1294 if (strlen(snamej)) cout << " Name : " << snamej;
1295 if (strlen(stitlej)) cout << " Title : " << stitlej;
1296 cout << endl;
1297 }
1298 }
1299 }
1300}
1301
1302void NcSignal::ListTrack(Int_t j) const
1303{
1313
1314 if (j<-1)
1315 {
1316 cout << " *NcSignal::ListTrack* Invalid argument j = " << j << endl;
1317 return;
1318 }
1319
1320 if (j != -1)
1321 {
1322 const char* name=GetName();
1323 const char* title=GetTitle();
1324
1325 cout << " *" << ClassName() << "::Data* Id :" << GetUniqueID();
1326 if (strlen(name)) cout << " Name : " << name;
1327 if (strlen(title)) cout << " Title : " << title;
1328 cout << endl;
1329 if (fDevice)
1330 {
1331 const char* devname=fDevice->GetName();
1332 const char* devtitle=fDevice->GetTitle();
1333 cout << " Owned by device : " << fDevice->ClassName();
1334 if (strlen(devname)) cout << " Name : " << devname;
1335 if (strlen(devtitle)) cout << " Title : " << devtitle;
1336 cout << endl;
1337 }
1338 }
1339
1340 Int_t n=GetNtracks();
1341 NcTrack* tx=0;
1342
1343 if (j<=0)
1344 {
1345 for (Int_t i=1; i<=n; i++)
1346 {
1347 tx=GetTrack(i);
1348 if (tx)
1349 {
1350 const char* txname=tx->GetName();
1351 const char* txtitle=tx->GetTitle();
1352 cout << " Track " << i << " : " << tx->ClassName() << " Id : " << tx->GetId();
1353 if (strlen(txname)) cout << " Name : " << txname;
1354 if (strlen(txtitle)) cout << " Title : " << txtitle;
1355 cout << endl;
1356 }
1357 }
1358 }
1359 else
1360 {
1361 if (j<=n)
1362 {
1363 tx=GetTrack(j);
1364 if (tx)
1365 {
1366 const char* txnamej=tx->GetName();
1367 const char* txtitlej=tx->GetTitle();
1368 cout << " Track " << j << " : " << tx->ClassName() << " Id : " << tx->GetId();
1369 if (strlen(txnamej)) cout << " Name : " << txnamej;
1370 if (strlen(txtitlej)) cout << " Title : " << txtitlej;
1371 cout << endl;
1372 }
1373 }
1374 }
1375}
1376
1378{
1384
1385 if (!fSignals) return 0;
1386
1387 Int_t n=0;
1388 for (Int_t i=1; i<=fSigflags->GetSize(); i++)
1389 {
1390 if (GetSignalFlag(i)) n=i;
1391 }
1392
1393 return n;
1394}
1395
1397{
1403
1404 if (!fDsignals) return 0;
1405
1406 Int_t n=0;
1407 for (Int_t i=1; i<=fSigflags->GetSize(); i++)
1408 {
1409 if (GetErrorFlag(i)) n=i;
1410 }
1411
1412 return n;
1413}
1414
1415void NcSignal::SetSigFlags(Int_t is,Int_t ie,Int_t j)
1416{
1427
1428 if (j<1)
1429 {
1430 cout << " *NcSignal::SetSigFlags* Invalid argument j = " << j << endl;
1431 return;
1432 }
1433
1434 if (!fSigflags)
1435 {
1436 fSigflags=new TArrayI(j);
1437 }
1438
1439 Int_t size=fSigflags->GetSize();
1440
1441 if (j>size)
1442 {
1443 fSigflags->Set(j);
1444 }
1445
1446 Int_t word=10*is+ie;
1447
1448 fSigflags->AddAt(word,j-1);
1449}
1450
1451Int_t NcSignal::GetSignalFlag(Int_t j) const
1452{
1464
1465 if (j<1)
1466 {
1467 cout << " *NcSignal::GetSignalFlag* Invalid argument j = " << j << endl;
1468 return 0;
1469 }
1470 Int_t flag=0;
1471 if (fSigflags)
1472 {
1473 if (j>0 && j<=(fSigflags->GetSize()))
1474 {
1475 Int_t word=fSigflags->At(j-1);
1476 flag=word/10;
1477 }
1478 }
1479 return flag;
1480}
1481
1482Int_t NcSignal::GetSignalFlag(TString name) const
1483{
1499
1500 if (!fSigflags) return 0;
1501
1502 Int_t j=GetSlotIndex(name);
1503 Int_t flag=0;
1504 if (j>0) flag=GetSignalFlag(j);
1505 return flag;
1506}
1507
1508Int_t NcSignal::GetErrorFlag(Int_t j) const
1509{
1521
1522 if (j<1)
1523 {
1524 cout << " *NcSignal::GetErrorFlag* Invalid argument j = " << j << endl;
1525 return 0;
1526 }
1527 Int_t flag=0;
1528 if (fSigflags)
1529 {
1530 if (j>0 && j<=(fSigflags->GetSize()))
1531 {
1532 Int_t word=fSigflags->At(j-1);
1533 flag=word%10;
1534 }
1535 }
1536 return flag;
1537}
1538
1539Int_t NcSignal::GetErrorFlag(TString name) const
1540{
1556
1557 if (!fSigflags) return 0;
1558
1559 Int_t j=GetSlotIndex(name);
1560 Int_t flag=0;
1561 if (j>0) flag=GetErrorFlag(j);
1562 return flag;
1563}
1564
1566{
1572
1573 Int_t n=NcAttrib::GetNslots();
1574
1575 if (!fSigflags) return n;
1576
1577 Int_t nflags=0;
1578 for (Int_t i=0; i<fSigflags->GetSize(); i++)
1579 {
1580 if (fSigflags->At(i)) nflags=i+1;
1581 }
1582
1583 if (n<nflags) n=nflags;
1584
1585 return n;
1586}
1587
1589{
1606
1607 Int_t n=-1;
1608 if (fWaveforms) n=fWaveforms->GetLast();
1609 return (n+1);
1610}
1611
1612TH1F* NcSignal::GetWaveform(Int_t j) const
1613{
1619
1620 TH1F* waveform=0;
1621 if (j>0 && j<=GetNwaveforms()) waveform=(TH1F*)fWaveforms->At(j-1);
1622 return waveform;
1623}
1624
1625TH1F* NcSignal::GetWaveform(TString name) const
1626{
1641
1642 Int_t n=GetNwaveforms();
1643 TString str;
1644 for (Int_t i=1; i<=n; i++)
1645 {
1646 TH1F* waveform=GetWaveform(i);
1647 if (waveform)
1648 {
1649 str=waveform->GetName();
1650 if (str.Contains(name)) return waveform;
1651 }
1652 }
1653 return 0; // No match found
1654}
1655
1656Int_t NcSignal::GetWaveformIndex(TString name) const
1657{
1672
1673 Int_t n=GetNwaveforms();
1674 TString str;
1675 for (Int_t i=1; i<=n; i++)
1676 {
1677 TH1F* waveform=GetWaveform(i);
1678 if (waveform)
1679 {
1680 str=waveform->GetName();
1681 if (str.Contains(name)) return i;
1682 }
1683 }
1684 return 0; // No match found
1685}
1686
1687void NcSignal::SetWaveform(TH1F* waveform,Int_t j)
1688{
1713
1714 if (j<1) return;
1715
1716 if (!fWaveforms)
1717 {
1718 fWaveforms=new TObjArray(j);
1719 fWaveforms->SetOwner();
1720 }
1721
1722 if (j > fWaveforms->GetSize()) fWaveforms->Expand(j);
1723
1724 TH1F* hcur=(TH1F*)fWaveforms->At(j-1);
1725 if (waveform != hcur)
1726 {
1727 if (hcur)
1728 {
1729 fWaveforms->Remove(hcur);
1730 delete hcur;
1731 hcur=0;
1732 }
1733 if (waveform)
1734 {
1735 hcur=new TH1F(*waveform);
1736 fWaveforms->AddAt(hcur,j-1);
1737 }
1738 }
1739}
1740
1742{
1752
1753 if (!fWaveforms) return;
1754
1755 Int_t size=fWaveforms->GetSize();
1756
1757 if ((j>=0) && (j<=size))
1758 {
1759 if (j)
1760 {
1761 TH1F* hwave=(TH1F*)fWaveforms->At(j-1);
1762 if (hwave) hwave->Reset();
1763 }
1764 else
1765 {
1766 for (Int_t i=0; i<size; i++)
1767 {
1768 TH1F* hwave=(TH1F*)fWaveforms->At(i);
1769 if (hwave) hwave->Reset();
1770 }
1771 }
1772 }
1773 else
1774 {
1775 cout << " *NcSignal::ResetWaveform* Index j = " << j << " invalid." << endl;
1776 return;
1777 }
1778}
1779
1780void NcSignal::ResetWaveform(TString name)
1781{
1787
1788 Int_t j=GetWaveformIndex(name);
1789 if (j>0) ResetWaveform(j);
1790}
1791
1793{
1801
1802 if (!fWaveforms) return;
1803
1804 Int_t size=fWaveforms->GetSize();
1805
1806 if ((j>=0) && (j<=size))
1807 {
1808 if (j)
1809 {
1810 TH1F* hwave=(TH1F*)fWaveforms->At(j-1);
1811 if (hwave)
1812 {
1813 fWaveforms->Remove(hwave);
1814 delete hwave;
1815 }
1816 }
1817 else
1818 {
1819 delete fWaveforms;
1820 fWaveforms=0;
1821 }
1822 }
1823 else
1824 {
1825 cout << " *NcSignal::DeleteWaveform* Index j = " << j << " invalid." << endl;
1826 return;
1827 }
1828}
1829
1831{
1837
1838 Int_t j=GetWaveformIndex(name);
1839 if (j>0) DeleteWaveform(j);
1840}
1841
1843{
1860
1861 Int_t n=-1;
1862 if (fSamples) n=fSamples->GetLast();
1863 return (n+1);
1864}
1865
1867{
1873
1874 NcSample* sample=0;
1875 if (j>0 && j<=GetNsamples()) sample=(NcSample*)fSamples->At(j-1);
1876 return sample;
1877}
1878
1879NcSample* NcSignal::GetSample(TString name) const
1880{
1895
1896 Int_t n=GetNsamples();
1897 TString str;
1898 for (Int_t i=1; i<=n; i++)
1899 {
1900 NcSample* sample=GetSample(i);
1901 if (sample)
1902 {
1903 str=sample->GetName();
1904 if (str.Contains(name)) return sample;
1905 }
1906 }
1907 return 0; // No match found
1908}
1909
1910Int_t NcSignal::GetSampleIndex(TString name) const
1911{
1926
1927 Int_t n=GetNsamples();
1928 TString str;
1929 for (Int_t i=1; i<=n; i++)
1930 {
1931 NcSample* sample=GetSample(i);
1932 if (sample)
1933 {
1934 str=sample->GetName();
1935 if (str.Contains(name)) return i;
1936 }
1937 }
1938 return 0; // No match found
1939}
1940
1941void NcSignal::SetSample(NcSample* sample,Int_t j)
1942{
1966
1967 if (j<1) return;
1968
1969 if (!fSamples)
1970 {
1971 fSamples=new TObjArray(j);
1972 fSamples->SetOwner();
1973 }
1974
1975 if (j > fSamples->GetSize()) fSamples->Expand(j);
1976
1977 NcSample* hcur=(NcSample*)fSamples->At(j-1);
1978 if (sample != hcur)
1979 {
1980 if (hcur)
1981 {
1982 fSamples->Remove(hcur);
1983 delete hcur;
1984 hcur=0;
1985 }
1986 if (sample)
1987 {
1988 hcur=new NcSample(*sample);
1989 fSamples->AddAt(hcur,j-1);
1990 }
1991 }
1992}
1993
1995{
2005
2006 if (!fSamples) return;
2007
2008 Int_t size=fSamples->GetSize();
2009
2010 if ((j>=0) && (j<=size))
2011 {
2012 if (j)
2013 {
2014 NcSample* sample=(NcSample*)fSamples->At(j-1);
2015 if (sample) sample->Reset();
2016 }
2017 else
2018 {
2019 for (Int_t i=0; i<size; i++)
2020 {
2021 NcSample* sample=(NcSample*)fSamples->At(i);
2022 if (sample) sample->Reset();
2023 }
2024 }
2025 }
2026 else
2027 {
2028 cout << " *NcSignal::ResetSample* Index j = " << j << " invalid." << endl;
2029 return;
2030 }
2031}
2032
2033void NcSignal::ResetSample(TString name)
2034{
2040
2041 Int_t j=GetSampleIndex(name);
2042 if (j>0) ResetSample(j);
2043}
2044
2046{
2054
2055 if (!fSamples) return;
2056
2057 Int_t size=fSamples->GetSize();
2058
2059 if ((j>=0) && (j<=size))
2060 {
2061 if (j)
2062 {
2063 NcSample* sample=(NcSample*)fSamples->At(j-1);
2064 if (sample)
2065 {
2066 fSamples->Remove(sample);
2067 delete sample;
2068 }
2069 }
2070 else
2071 {
2072 delete fSamples;
2073 fSamples=0;
2074 }
2075 }
2076 else
2077 {
2078 cout << " *NcSignal::DeleteSample* Index j = " << j << " invalid." << endl;
2079 return;
2080 }
2081}
2082
2083void NcSignal::DeleteSample(TString name)
2084{
2090
2091 Int_t j=GetSampleIndex(name);
2092 if (j>0) DeleteSample(j);
2093}
2094
2095Int_t NcSignal::GetNlinks(TObject* obj,Int_t j) const
2096{
2106
2107 if (j<0)
2108 {
2109 cout << " *NcSignal::GetNlinks* Index j = " << j << " invalid." << endl;
2110 return 0;
2111 }
2112
2113 if (!fLinks) return 0;
2114
2115 Int_t n=0;
2116 if (!j)
2117 {
2118 n=fLinks->GetNrefs(obj);
2119 }
2120 else
2121 {
2122 TArrayI posarr;
2123 n=GetIndices(obj,j,posarr);
2124 }
2125 return n;
2126}
2127
2128Int_t NcSignal::GetNlinks(TObject* obj,TString name) const
2129{
2142
2143 Int_t j=GetSlotIndex(name);
2144 Int_t n=0;
2145 if (j>0) n=GetNlinks(obj,j);
2146 return n;
2147}
2148
2149TObject* NcSignal::GetLink(Int_t j,Int_t k) const
2150{
2156
2157 TObject* obj=0;
2158 // Note : In the internal storage matrix slots=columns positions=rows
2159 if (fLinks) obj=fLinks->GetObject(k,j);
2160 return obj;
2161}
2162
2163TObject* NcSignal::GetLink(TString name,Int_t k) const
2164{
2176
2177 Int_t j=GetSlotIndex(name);
2178 TObject* obj=0;
2179 if (j>0) obj=GetLink(j,k);
2180 return obj;
2181}
2182
2183void NcSignal::SetLink(TObject* obj,Int_t j,Int_t k)
2184{
2222
2223 if (!fLinks && obj) fLinks=new NcObjMatrix();
2224
2225 if (!fLinks) return;
2226
2227 // Note : In the internal storage matrix slots=columns positions=rows
2228 fLinks->EnterObject(k,j,obj);
2229 if (obj)
2230 {
2231 if (obj->InheritsFrom("NcTrack"))
2232 {
2233 NcTrack* t=(NcTrack*)obj;
2234 AddTrack(*t,1);
2235 }
2236 }
2237}
2238
2239void NcSignal::SetLink(TObject* obj,TString name,Int_t k)
2240{
2278
2279 Int_t j=GetSlotIndex(name);
2280 if (j>0) SetLink(obj,j,k);
2281}
2282
2283void NcSignal::AddLink(TObject* obj,Int_t j)
2284{
2322
2323 if (!obj || j<=0) return;
2324
2325 if (!fLinks) fLinks=new NcObjMatrix();
2326
2327 TObject* dum=0;
2328 Int_t n=GetNlinks(dum,j);
2329 Int_t pos=1;
2330 for (Int_t k=1; k<=n; k++)
2331 {
2332 dum=GetLink(j,k);
2333 if (!dum) break;
2334 pos++;
2335 }
2336
2337 SetLink(obj,j,pos);
2338}
2339
2340void NcSignal::AddLink(TObject* obj,TString name)
2341{
2380
2381 Int_t j=GetSlotIndex(name);
2382 if (j>0) AddLink(obj,j);
2383}
2384
2385void NcSignal::ResetLink(Int_t j,Int_t k)
2386{
2411
2412 // Note : In the internal storage matrix slots=columns positions=rows
2413 if (fLinks) fLinks->RemoveObject(k,j);
2414}
2415
2416void NcSignal::ResetLink(TString name,Int_t k)
2417{
2432
2433 Int_t j=GetSlotIndex(name);
2434 if (j>0) ResetLink(j,k);
2435}
2436
2437void NcSignal::ResetLinks(TObject* obj,Int_t j,Int_t k)
2438{
2490
2491 if (!fLinks) return;
2492
2493 if (!obj && !j && !k)
2494 {
2495 fLinks->Reset();
2496 }
2497 else
2498 {
2499 // Note : In the internal storage matrix slots=columns positions=rows
2500 fLinks->RemoveObjects(obj,k,j);
2501 }
2502}
2503
2504void NcSignal::ResetLinks(TObject* obj,TString name,Int_t k)
2505{
2545
2546 Int_t j=GetSlotIndex(name);
2547 if (j>0) ResetLinks(obj,j,k);
2548}
2549
2550Int_t NcSignal::GetIndices(TObject* obj,TArrayI& js,TArrayI& ks) const
2551{
2579
2580 Int_t nrefs=0;
2581 js.Reset();
2582 ks.Reset();
2583 // Note : In the internal storage matrix slots=columns positions=rows
2584 if (fLinks) nrefs=fLinks->GetIndices(obj,ks,js);
2585 return nrefs;
2586}
2587
2588Int_t NcSignal::GetIndices(TObject* obj,Int_t j,TArrayI& ks) const
2589{
2620
2621 Int_t nrefs=0;
2622 ks.Reset();
2623 // Note : In the internal storage matrix slots=columns positions=rows
2624 if (fLinks) nrefs=fLinks->GetIndices(obj,ks,j);
2625 return nrefs;
2626}
2627
2628Int_t NcSignal::GetIndices(TObject* obj,TString name,TArrayI& ks) const
2629{
2648
2649 Int_t j=GetSlotIndex(name);
2650 Int_t n=0;
2651 if (j>0) n=GetIndices(obj,j,ks);
2652 return n;
2653}
2654
2655Int_t NcSignal::GetIndices(TObject* obj,TArrayI& js,Int_t k) const
2656{
2687
2688 Int_t nrefs=0;
2689 js.Reset();
2690 // Note : In the internal storage matrix slots=columns positions=rows
2691 if (fLinks) nrefs=fLinks->GetIndices(obj,k,js);
2692 return nrefs;
2693}
2694
2696{
2713
2714 if (!fLinks) fLinks=new NcObjMatrix();
2715 fLinks->SetSwapMode(swap);
2716}
2717
2719{
2725
2726 Int_t swap=0;
2727 if (fLinks) swap=fLinks->GetSwapMode();
2728 return swap;
2729}
2730
2732{
2739
2740 if (fDevset)
2741 {
2742 fDevice=dev;
2743 }
2744 else
2745 {
2746 cout << " *" << ClassName() << "::SetDevice* Invokation by public users is not allowed." << endl;
2747 }
2748}
2749
2751{
2757
2758 return (NcDevice*)fDevice;
2759}
2760
2761void NcSignal::AddTrack(NcTrack& t,Int_t mode)
2762{
2780
2781 if (!fTracks) fTracks=new TObjArray(1);
2782
2783 // Check if this track is already stored for this signal
2784 Int_t ntk=GetNtracks();
2785 for (Int_t i=0; i<ntk; i++)
2786 {
2787 if (&t==fTracks->At(i)) return;
2788 }
2789
2790 fTracks->Add(&t);
2791 if (mode==1) t.AddSignal(*this,0);
2792}
2793
2795{
2812
2813 if (fTracks)
2814 {
2815 NcTrack* test=(NcTrack*)fTracks->Remove(&t);
2816 if (test) fTracks->Compress();
2817 }
2818
2819 ResetLinks(&t);
2820
2821 if (mode==1) t.RemoveSignal(*this,0);
2822}
2823
2825{
2841
2842 if (!fTracks) return;
2843
2844 Int_t ntk=GetNtracks();
2845 for (Int_t i=0; i<ntk; i++)
2846 {
2847 NcTrack* tx=(NcTrack*)fTracks->At(i);
2848 if (tx)
2849 {
2850 ResetLinks(tx);
2851 if (mode==1) tx->RemoveSignal(*this,0);
2852 }
2853 }
2854
2855 delete fTracks;
2856 fTracks=0;
2857}
2858
2860{
2871
2872 if (!fTracks) return 0;
2873
2874 Int_t ntk=fTracks->GetEntries();
2875
2876 if (!t) return ntk;
2877
2878 for (Int_t i=0; i<ntk; i++)
2879 {
2880 NcTrack* tx=(NcTrack*)fTracks->At(i);
2881 if (tx==t) return 1;
2882 }
2883
2884 return 0;
2885}
2886
2888{
2895
2896 if (!fTracks) return 0;
2897
2898 if ((j >= 1) && (j <= GetNtracks()))
2899 {
2900 return (NcTrack*)fTracks->At(j-1);
2901 }
2902 else
2903 {
2904 cout << " *NcSignal* track number : " << j << " out of range."
2905 << " Ntk = " << GetNtracks() << endl;
2906 return 0;
2907 }
2908}
2909
2911{
2917
2918 if (!fTracks) return 0;
2919
2920 NcTrack* tx=0;
2921 for (Int_t i=0; i<GetNtracks(); i++)
2922 {
2923 tx=(NcTrack*)fTracks->At(i);
2924 if (id == tx->GetId()) return tx;
2925 }
2926 return 0; // No matching id found
2927}
2928
2929NcSample* NcSignal::DisplaySample(Int_t j,Int_t i) const
2930{
2948
2949 if (j<1) return 0;
2950
2951 TGraph gr;
2952 NcSample* sx=GetSample(i);
2953 Int_t ndim=0;
2954 if (sx)
2955 {
2956 ndim=sx->GetDimension();
2957 if (j<=ndim)
2958 {
2959 gr=sx->GetGraph(j);
2960 gr.DrawClone("AL");
2961 }
2962 }
2963
2964 return sx;
2965}
2966
2967NcSample* NcSignal::DisplaySample(TString name,Int_t i) const
2968{
2986
2987 TGraph gr;
2988 NcSample* sx=GetSample(i);
2989 if (sx)
2990 {
2991 gr=sx->GetGraph(name);
2992 gr.SetTitle("aap");
2993 gr.DrawClone("AL");
2994 }
2995
2996 return sx;
2997}
2998
2999TObject* NcSignal::Clone(const char* name) const
3000{
3012
3013 NcSignal* sig=new NcSignal(*this);
3014 if (name)
3015 {
3016 if (strlen(name)) sig->SetName(name);
3017 }
3018 return sig;
3019}
3020
ClassImp(NcSignal)
Int_t fNv
Definition Nc3Vector.h:59
TString GetSlotName(Int_t j=1) const
Float_t GetGain(Int_t j=1) const
Definition NcAttrib.cxx:576
void Lock(Int_t j=1)
Definition NcAttrib.cxx:995
virtual Int_t GetNslots() const
Int_t GetGainFlag(Int_t j=1) const
Definition NcAttrib.cxx:417
Int_t GetDeadValue(Int_t j=1) const
Int_t GetCalWord(Int_t j=1) const
Definition NcAttrib.cxx:529
Int_t GetSlotIndex(TString name, Int_t opt=0) const
Float_t GetOffset(Int_t j=1) const
Definition NcAttrib.cxx:624
void DeleteCalibrations(Int_t mode=0)
Definition NcAttrib.cxx:786
TF1 * GetCalFunction(Int_t j=1) const
Int_t GetOffsetFlag(Int_t j=1) const
Definition NcAttrib.cxx:473
Int_t GetLockValue(Int_t j=1) const
virtual void List(Int_t j=0) const
TF1 * GetDecalFunction(Int_t j=1) const
void Unlock(Int_t j=1)
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
void RemoveHit(NcSignal &s)
Definition NcDevice.cxx:388
Handling of a matrix structure of objects.
Definition NcObjMatrix.h:13
virtual void Data(TString f="car", TString u="rad") const
void ResetPosition()
Sampling and statistics tools for various multi-dimensional data samples.
Definition NcSample.h:28
void Reset()
Definition NcSample.cxx:255
Int_t GetDimension() const
TGraph GetGraph(Int_t i, TF1 *f=0)
Generic handling of (extrapolated) detector signals.
Definition NcSignal.h:23
virtual void DeleteSignals(Int_t mode=0)
Definition NcSignal.cxx:449
void SetSigFlags(Int_t is, Int_t ie, Int_t j)
Int_t GetNwaveforms() const
virtual void ResetSignals(Int_t mode=0)
Definition NcSignal.cxx:396
virtual void Reset(Int_t mode=0)
Definition NcSignal.cxx:334
void DeleteWaveform(Int_t j=1)
virtual void List(Int_t j=0) const
Int_t GetNtracks(NcTrack *t=0) const
NcSample * DisplaySample(Int_t j=1, Int_t i=1) const
void ResetLink(Int_t j=1, Int_t k=1)
TH1F * GetWaveform(Int_t j=1) const
virtual void SetSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:516
Int_t GetSampleIndex(TString name) const
void SetSwapMode(Int_t swap=1)
TObject * fDevice
Definition NcSignal.h:113
NcObjMatrix * fLinks
Definition NcSignal.h:112
void RemoveTracks(Int_t mode=1)
NcDevice * GetDevice() const
TArrayI * fSigflags
Definition NcSignal.h:109
Int_t GetNlinks(TObject *obj=0, Int_t j=0) const
void ListWaveform(Int_t j=0) const
NcSample * GetSample(Int_t j=1) const
virtual TObject * Clone(const char *name="") const
void ListSample(Int_t j=0) const
Bool_t fDevset
Definition NcSignal.h:103
void RemoveTrack(NcTrack &t, Int_t mode=1)
NcTrack * GetIdTrack(Int_t id) const
Int_t GetIndices(TObject *obj, TArrayI &js, TArrayI &ks) const
void SetDevice(NcDevice *dev)
void SetWaveform(TH1F *waveform, Int_t j=1)
Int_t GetSwapMode() const
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Definition NcSignal.cxx:651
NcSignal(const char *name="", const char *title="")
Definition NcSignal.cxx:155
virtual Int_t GetNslots() const
void SetSample(NcSample *sample, Int_t j=1)
TArrayF * fDsignals
Definition NcSignal.h:108
void AddTrack(NcTrack &t, Int_t mode=1)
void DeleteSample(Int_t j=1)
TObject * GetLink(Int_t j=1, Int_t k=1) const
void ResetSample(Int_t j=1)
virtual Float_t GetSignalError(Int_t j=1) const
Definition NcSignal.cxx:912
void ListTrack(Int_t j=0) const
Int_t GetNsamples() const
virtual void AddSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:583
TArrayF * fSignals
Definition NcSignal.h:107
TObjArray * fSamples
Definition NcSignal.h:111
virtual ~NcSignal()
Definition NcSignal.cxx:177
virtual void Data(TString f="car", TString u="rad") const
Definition NcSignal.cxx:959
virtual void SetSignalError(Double_t dsig, Int_t j=1)
Definition NcSignal.cxx:845
TObjArray * fWaveforms
Definition NcSignal.h:110
Int_t GetNvalues() const
void AddLink(TObject *obj, Int_t j=1)
Int_t GetSignalFlag(Int_t j=1) const
void ResetWaveform(Int_t j=1)
NcTrack * GetTrack(Int_t j) const
Int_t GetNerrors() const
Int_t GetErrorFlag(Int_t j=1) const
Int_t GetWaveformIndex(TString name) const
void SetLink(TObject *obj, Int_t j=1, Int_t k=1)
TObjArray * fTracks
Definition NcSignal.h:114
void ResetLinks(TObject *obj, Int_t j=0, Int_t k=0)
Handling of the attributes of a reconstructed particle track.
Definition NcTrack.h:19
Int_t GetId() const
Definition NcTrack.cxx:1783
void AddSignal(NcSignal &s, Int_t mode=0)
Definition NcTrack.cxx:886
void RemoveSignal(NcSignal &s, Int_t mode=1)
Definition NcTrack.cxx:916