27 #if !defined(__CINT__) || defined(__MAKECINT__) 46 #include <Riostream.h> 47 #include <TObjArray.h> 48 #include <TIterator.h> 61 Int_t
Compare(
const TObject* a,
const TObject*
b)
64 if (a->IsA() == AliMUONLocalTrigger::Class() && b->IsA() == AliMUONLocalTrigger::Class())
68 else if (a->IsA() == AliMUONRegionalTrigger::Class() && b->IsA() == AliMUONRegionalTrigger::Class())
84 else if (a->IsA() == AliMUONGlobalTrigger::Class() && b->IsA() == AliMUONGlobalTrigger::Class())
90 result = memcmp(a, b,
sizeof(TObject));
93 if (result < 0)
return -1;
94 if (result > 0)
return 1;
114 TObjArray localsFromStore, regionalsFromStore;
115 localsFromStore.SetOwner(kTRUE);
116 regionalsFromStore.SetOwner(kTRUE);
118 if (store == NULL)
return false;
122 while ( (localTrig = static_cast<AliMUONLocalTrigger*>( nextLocal() )) != NULL )
124 localsFromStore.Add(localTrig->Clone());
128 while ( (regionalTrig = static_cast<AliMUONRegionalTrigger*>( nextRegional() )) != NULL )
130 regionalsFromStore.Add(regionalTrig->Clone());
133 TObjArray localsByIndex, regionalsByIndex;
134 localsByIndex.SetOwner(kTRUE);
135 regionalsByIndex.SetOwner(kTRUE);
139 for (Int_t i = 0; i < nlocals; i++)
142 localsByIndex.Add(localTrig->Clone());
145 for (Int_t i = 0; i < nregionals; i++)
148 regionalsByIndex.Add(regionalTrig->Clone());
155 if (
Compare(globalFromStore, globalByMethod) != 0)
157 Error(
"SimTriggersOk",
158 "The AliMUONMCDataInterface does not return identical global" 159 " triggers through all its user interface methods." 161 globalFromStore->
Print();
162 globalByMethod->
Print();
165 delete globalFromStore;
166 delete globalByMethod;
167 if (localsFromStore.GetEntriesFast() != localsByIndex.GetEntriesFast())
169 Error(
"SimTriggersOk",
170 "The AliMUONMCDataInterface does not return all the local triggers" 171 " correctly through all its user interface methods. We got the" 172 " following numbers of local triggers: %d and %d",
173 localsFromStore.GetEntriesFast(),
174 localsByIndex.GetEntriesFast()
178 if (regionalsFromStore.GetEntriesFast() != regionalsByIndex.GetEntriesFast())
180 Error(
"SimTriggersOk",
181 "The AliMUONMCDataInterface does not return all the regional triggers" 182 " correctly through all its user interface methods. We got the" 183 " following numbers of regional triggers: %d and %d",
184 regionalsFromStore.GetEntriesFast(),
185 regionalsByIndex.GetEntriesFast()
189 for (Int_t i = 0; i < localsFromStore.GetEntriesFast(); i++)
191 if (
Compare(localsFromStore[i], localsByIndex[i]) != 0)
193 Error(
"SimTriggersOk",
194 "The AliMUONMCDataInterface does not return identical local" 195 " triggers through all its user interface methods. The" 196 " incorrect local trigger has index %d.",
199 localsFromStore[i]->Print();
200 localsByIndex[i]->Print();
204 for (Int_t i = 0; i < regionalsFromStore.GetEntriesFast(); i++)
206 if (
Compare(regionalsFromStore[i], regionalsByIndex[i]) != 0)
208 Error(
"SimTriggersOk",
209 "The AliMUONMCDataInterface does not return identical regional" 210 " triggers through all its user interface methods. The" 211 " incorrect regional trigger has index %d.",
214 regionalsFromStore[i]->Print();
215 regionalsByIndex[i]->Print();
218 regionalsFromStore[i]->Print();
219 regionalsByIndex[i]->Print();
239 digitsFromStore.SetOwner(kTRUE);
241 if (store == NULL)
return false;
244 while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
246 digitsFromStore.Add(digit->Clone());
248 digitsFromStore.Sort();
251 digitsByDetElem.SetOwner(kTRUE);
253 for (Int_t detElem = 0; detElem < 1500; detElem++)
257 for (Int_t i = 0; i < ndigits; i++)
260 digitsByDetElem.Add(digit->Clone());
263 digitsByDetElem.Sort();
266 digitsByChamber.SetOwner(kTRUE);
269 for (Int_t cathode = 0; cathode < 2; cathode++)
272 for (Int_t i = 0; i < ndigits; i++)
275 digitsByChamber.Add(digit->Clone());
278 digitsByChamber.Sort();
283 if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
284 || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
286 Error(
"SimSDigitsOk",
287 "The AliMUONMCDataInterface does not return all the s-digits correctly" 288 " through all its user interface methods. We got the following" 289 " numbers of s-digits: %d, %d and %d",
290 digitsFromStore.GetEntriesFast(),
291 digitsByDetElem.GetEntriesFast(),
292 digitsByChamber.GetEntriesFast()
296 for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
298 if (digitsFromStore[i]->
Compare(digitsByDetElem[i]) != 0
299 || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
301 Error(
"SimSDigitsOk",
302 "The AliMUONMCDataInterface does not return identical s-digits" 303 " through all its user interface methods. The incorrect" 304 " s-digit has index %d after sorting.",
307 digitsFromStore[i]->Print();
308 digitsByChamber[i]->Print();
309 digitsByDetElem[i]->Print();
331 digitsFromStore.SetOwner(kTRUE);
333 if (store == NULL)
return false;
336 while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
338 digitsFromStore.Add(digit->Clone());
340 digitsFromStore.Sort();
343 digitsByDetElem.SetOwner(kTRUE);
345 for (Int_t detElem = 0; detElem < 1500; detElem++)
349 for (Int_t i = 0; i < ndigits; i++)
352 digitsByDetElem.Add(digit->Clone());
355 digitsByDetElem.Sort();
358 digitsByChamber.SetOwner(kTRUE);
361 for (Int_t cathode = 0; cathode < 2; cathode++)
364 for (Int_t i = 0; i < ndigits; i++)
367 digitsByChamber.Add(digit->Clone());
370 digitsByChamber.Sort();
375 if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
376 || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
378 Error(
"SimDigitsOk",
379 "The AliMUONMCDataInterface does not return all the digits correctly" 380 " through all its user interface methods. We got the following" 381 " numbers of digits: %d, %d and %d",
382 digitsFromStore.GetEntriesFast(),
383 digitsByDetElem.GetEntriesFast(),
384 digitsByChamber.GetEntriesFast()
388 for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
390 if (digitsFromStore[i]->
Compare(digitsByDetElem[i]) != 0
391 || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
393 Error(
"SimDigitsOk",
394 "The AliMUONMCDataInterface does not return identical digits" 395 " through all its user interface methods. The incorrect" 396 " digit has index %d after sorting.",
399 digitsFromStore[i]->Print();
400 digitsByChamber[i]->Print();
401 digitsByDetElem[i]->Print();
424 "The AliMUONMCDataInterface does not return the same number of tracks" 425 " through all its user interface methods. We got the following" 426 " numbers of tracks: %d and %d",
436 hitsFromStore.SetOwner(kTRUE);
438 if (store == NULL)
return false;
441 while ( (hit = static_cast<AliMUONHit*>( next() )) != NULL )
443 hitsFromStore.Add(hit->Clone());
448 hitsByMethod.SetOwner(kTRUE);
453 hitsByMethod.Add(hit->Clone());
460 if (hitsFromStore.GetEntriesFast() != hitsByMethod.GetEntriesFast())
463 "The AliMUONMCDataInterface does not return all the hits correctly" 464 " through all its user interface methods. We got the following" 465 " numbers of hits: %d and %d",
466 hitsFromStore.GetEntriesFast(),
467 hitsByMethod.GetEntriesFast()
471 for (Int_t i = 0; i < hitsFromStore.GetEntriesFast(); i++)
473 if (
Compare(hitsFromStore[i], hitsByMethod[i]) != 0)
476 "The AliMUONMCDataInterface does not return identical hits" 477 " through all its user interface methods. The incorrect" 478 " hit has index %d after sorting, for track %d.",
481 hitsFromStore[i]->Print();
482 hitsByMethod[i]->Print();
505 digitsFromStore.SetOwner(kTRUE);
507 if (store == NULL)
return false;
510 while ( (digit = static_cast<AliMUONVDigit*>( next() )) != NULL )
512 digitsFromStore.Add(digit->Clone());
514 digitsFromStore.Sort();
517 digitsByDetElem.SetOwner(kTRUE);
519 for (Int_t detElem = 0; detElem < 1500; detElem++)
523 for (Int_t i = 0; i < ndigits; i++)
526 digitsByDetElem.Add(digit->Clone());
529 digitsByDetElem.Sort();
532 digitsByChamber.SetOwner(kTRUE);
535 for (Int_t cathode = 0; cathode < 2; cathode++)
538 for (Int_t i = 0; i < ndigits; i++)
541 digitsByChamber.Add(digit->Clone());
544 digitsByChamber.Sort();
549 if (digitsFromStore.GetEntriesFast() != digitsByDetElem.GetEntriesFast()
550 || digitsFromStore.GetEntriesFast() != digitsByChamber.GetEntriesFast())
552 Error(
"RecDigitsOk",
553 "The AliMUONDataInterface does not return all the digits correctly" 554 " through all its user interface methods. We got the following" 555 " numbers of digits: %d, %d and %d",
556 digitsFromStore.GetEntriesFast(),
557 digitsByDetElem.GetEntriesFast(),
558 digitsByChamber.GetEntriesFast()
562 for (Int_t i = 0; i < digitsFromStore.GetEntriesFast(); i++)
564 if (digitsFromStore[i]->
Compare(digitsByDetElem[i]) != 0
565 || digitsFromStore[i]->Compare(digitsByChamber[i]) != 0)
567 Error(
"RecDigitsOk",
568 "The AliMUONDataInterface does not return identical digits" 569 " through all its user interface methods. The incorrect" 570 " digit has index %d after sorting.",
573 digitsFromStore[i]->Print();
574 digitsByChamber[i]->Print();
575 digitsByDetElem[i]->Print();
597 clustersFromStore.SetOwner(kTRUE);
599 if (store == NULL)
return false;
602 while ( (cluster = static_cast<AliMUONVCluster*>( next() )) != NULL )
604 clustersFromStore.Add(cluster->Clone());
606 clustersFromStore.Sort();
609 clustersByChamber.SetOwner(kTRUE);
614 for (Int_t i = 0; i < nclusters; i++)
617 clustersByChamber.Add(cluster->Clone());
620 clustersByChamber.Sort();
625 if (clustersFromStore.GetEntriesFast() != clustersByChamber.GetEntriesFast())
627 Error(
"RawClustersOk",
628 "The AliMUONDataInterface does not return all the clusters correctly" 629 " through all its user interface methods. We got the following" 630 " numbers of clusters: %d and %d",
631 clustersFromStore.GetEntriesFast(),
632 clustersByChamber.GetEntriesFast()
636 for (Int_t i = 0; i < clustersFromStore.GetEntriesFast(); i++)
638 if (clustersFromStore[i]->
Compare(clustersByChamber[i]) != 0)
640 Error(
"RawClustersOk",
641 "The AliMUONDataInterface does not return identical clusters" 642 " through all its user interface methods. The incorrect" 643 " cluster has index %d after sorting.",
646 clustersFromStore[i]->Print();
647 clustersByChamber[i]->Print();
671 TObjArray localsFromStore, regionalsFromStore;
672 localsFromStore.SetOwner(kTRUE);
673 regionalsFromStore.SetOwner(kTRUE);
675 if (store == NULL)
return false;
679 while ( (localTrig = static_cast<AliMUONLocalTrigger*>( nextLocal() )) != NULL )
681 localsFromStore.Add(localTrig->Clone());
685 while ( (regionalTrig = static_cast<AliMUONRegionalTrigger*>( nextRegional() )) != NULL )
687 regionalsFromStore.Add(regionalTrig->Clone());
690 TObjArray localsByIndex, regionalsByIndex;
691 localsByIndex.SetOwner(kTRUE);
692 regionalsByIndex.SetOwner(kTRUE);
696 for (Int_t i = 0; i < nlocals; i++)
699 localsByIndex.Add(localTrig->Clone());
702 for (Int_t i = 0; i < nregionals; i++)
705 regionalsByIndex.Add(regionalTrig->Clone());
712 if (
Compare(globalFromStore, globalByMethod) != 0)
715 "The AliMUONDataInterface does not return identical global" 716 " triggers through all its user interface methods." 718 globalFromStore->
Print();
719 globalByMethod->
Print();
722 delete globalFromStore;
723 delete globalByMethod;
724 if (localsFromStore.GetEntriesFast() != localsByIndex.GetEntriesFast())
727 "The AliMUONDataInterface does not return all the local triggers" 728 " correctly through all its user interface methods. We got the" 729 " following numbers of local triggers: %d and %d",
730 localsFromStore.GetEntriesFast(),
731 localsByIndex.GetEntriesFast()
735 if (regionalsFromStore.GetEntriesFast() != regionalsByIndex.GetEntriesFast())
738 "The AliMUONDataInterface does not return all the regional triggers" 739 " correctly through all its user interface methods. We got the" 740 " following numbers of regional triggers: %d and %d",
741 regionalsFromStore.GetEntriesFast(),
742 regionalsByIndex.GetEntriesFast()
746 for (Int_t i = 0; i < localsFromStore.GetEntriesFast(); i++)
748 if (
Compare(localsFromStore[i], localsByIndex[i]) != 0)
751 "The AliMUONDataInterface does not return identical local" 752 " triggers through all its user interface methods. The" 753 " incorrect local trigger has index %d.",
756 localsFromStore[i]->Print();
757 localsByIndex[i]->Print();
761 for (Int_t i = 0; i < regionalsFromStore.GetEntriesFast(); i++)
763 if (
Compare(regionalsFromStore[i], regionalsByIndex[i]) != 0)
766 "The AliMUONDataInterface does not return identical regional" 767 " triggers through all its user interface methods. The" 768 " incorrect regional trigger has index %d.",
771 regionalsFromStore[i]->Print();
772 regionalsByIndex[i]->Print();
802 cout <<
"Checking simulated hits..." << endl;
804 cout <<
"Simulated hits look OK." << endl;
806 cout <<
"Checking simulated s-digits..." << endl;
808 cout <<
"Simulated s-digits look OK." << endl;
810 cout <<
"Checking simulated digits..." << endl;
812 cout <<
"Simulated digits look OK." << endl;
814 cout <<
"Checking simulated triggers..." << endl;
816 cout <<
"Simulated triggers look OK." << endl;
821 cout <<
"Checking reconstructed digits..." << endl;
823 cout <<
"Reconstructed digits look OK." << endl;
825 cout <<
"Checking raw clusters..." << endl;
827 cout <<
"Raw clusters look OK." << endl;
829 cout <<
"Checking reconstructed triggers..." << endl;
831 cout <<
"Reconstructed triggers look OK." << endl;
AliMUONVDigitStore * SDigitStore(Int_t event)
Int_t NumberOfDigits(Int_t detElemId)
virtual TIterator * CreateRegionalIterator() const =0
Create iterator on regional trigger.
static Int_t NofChambers()
Return number of chambers.
bool MUONCheckDI(bool checkSim=true, bool checkRec=true)
Int_t NumberOfRawClusters(Int_t chamber)
virtual TIterator * CreateLocalIterator() const =0
Create iterator on local trigger.
Int_t NumberOfHits(Int_t track)
Interface for a digit container.
Virtual store to hold digit.
AliMUONVDigit * Digit(Int_t detElemId, Int_t index)
An easy to use interface to MUON data.
UInt_t GetLocalOutput(Int_t n) const
Return local output Lpt & Hpt.
AliMUONGlobalTrigger * GlobalTrigger()
AliMUONRegionalTrigger * RegionalTrigger(Int_t index)
virtual void Print(Option_t *opt="") const
AliMUONVDigitStore * DigitStore(Int_t event)
Bool_t GetEvent(Int_t event=0)
Int_t NumberOfTracks(Int_t event)
AliMUONVTriggerStore * TriggerStore(Int_t event)
Int_t GetId() const
Return regional id.
AliMUONRegionalTrigger * RegionalTrigger(Int_t index)
AliMUONGlobalTrigger * GlobalTrigger()
Base class of a trigger information store.
virtual TIterator * CreateIterator() const =0
Create an iterator to loop over all our digits.
UShort_t GetLocalMask() const
Return local mask.
Char_t GetOutput() const
Return regional output (single muon:2, unlike sign:1, like sign:1)
AliMUONVDigitStore * DigitStore(Int_t event)
Reconstructed regional Trigger object.
Int_t NumberOfEvents() const
AliMUONHit * Hit(Int_t track, Int_t index)
abstract base class for clusters
Reconstructed Local Trigger object.
Int_t NumberOfSDigits(Int_t detElemId)
AliMUONVTriggerStore * TriggerStore(Int_t event, const char *treeLetter="R")
Int_t NumberOfLocalTriggers()
Int_t NumberOfRegionalTriggers()
Int_t Compare(const TObject *a, const TObject *b)
Interface of a cluster container.
virtual AliMUONGlobalTrigger * Global() const =0
Return global trigger.
AliMUONLocalTrigger * LocalTrigger(Int_t index)
Int_t NumberOfRegionalTriggers()
void SetDefaultStorage(const char *dbString)
Easy to use data access to MC information.
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over hits.
Bool_t GetEvent(Int_t event=0)
AliMUONVDigit * Digit(Int_t detElemId, Int_t index)
Int_t NumberOfDigits(Int_t detElemId)
AliMUONVHitStore * HitStore(Int_t event, Int_t track)
AliMUONVDigit * SDigit(Int_t detElemId, Int_t index)
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
Int_t NumberOfLocalTriggers()
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
static Bool_t IsValidDetElemId(Int_t detElemId, Bool_t warn=false)
static Int_t NofTrackingChambers()
Return number of tracking chambers.
AliMUONVClusterStore * ClusterStore(Int_t event)
AliMUONVCluster * RawCluster(Int_t chamber, Int_t index)
AliMUONLocalTrigger * LocalTrigger(Int_t index)
Int_t NumberOfEvents() const