112 #include "AliRawReader.h" 118 #include <Riostream.h> 119 #include <TObjArray.h> 120 #include <TClonesArray.h> 134 fTriggerCircuit(0x0),
135 fCalibrationData(0x0),
136 fDigitCalibrator(0x0),
140 fTriggerProcessor(0x0),
141 fTriggerUtilities(0x0),
144 fShouldCalibrate(kTRUE)
165 AliFatal(
"Could not access mapping from OCDB !");
169 fTransformer->LoadGeometryData();
171 fClusterServers.SetOwner(kTRUE);
172 fTrackers.SetOwner(kTRUE);
176 AliMUONReconstructor::~AliMUONReconstructor()
182 delete fDigitCalibrator;
187 delete fTriggerCircuit;
188 delete fTriggerStore;
190 delete fClusterStore;
191 delete fTriggerProcessor;
192 delete fTriggerUtilities;
197 delete fCalibrationData;
205 if (!fDigitCalibrator)
210 if ( fShouldCalibrate )
212 AliCodeTimerAuto(Form(
"%s::Calibrate(AliMUONVDigitStore*)",fDigitCalibrator->ClassName()),0)
213 fDigitCalibrator->Calibrate(digitStore);
229 triggerStore->Clear();
230 AliInfo(
"Calibration event: do not convert digits");
234 AliCodeTimerStart(Form(
"%s::Raw2Digits(AliRawReader*,AliMUONVDigitStore*,AliMUONVTriggerStore*)",
235 fDigitMaker->ClassName()))
236 fDigitMaker->Raw2Digits(rawReader,digitStore,triggerStore);
238 fDigitMaker->ClassName()))
239 Calibrate(*digitStore);
249 Bool_t alone = ( TriggerStore() == 0 );
251 Bool_t ok = DigitStore()->Connect(*digitsTree,alone);
252 if ( TriggerStore() )
254 ok = ok && TriggerStore()->Connect(*digitsTree,kFALSE);
259 AliError(
"Could not make branches on TreeD");
263 ConvertDigits(rawReader,DigitStore(),TriggerStore());
267 DigitStore()->
Clear();
276 if (fDigitMaker)
return;
280 TString option = GetOption();
282 Bool_t enableErrorLogging = kFALSE;
284 if (option.Contains("ENABLEERRORLOGGING"))
286 enableErrorLogging = kTRUE;
294 fDigitMaker->SetMakeTriggerDigits(kTRUE);
296 if ( GetRecoParam()->TryRecover() )
298 fDigitMaker->SetTryRecover(kTRUE);
302 fDigitMaker->SetTryRecover(kFALSE);
308 AliMUONReconstructor::CreateTriggerCircuit()
const 311 if (fTriggerCircuit)
return;
324 if ( fTriggerUtilities )
return;
328 if ( ! fCalibrationData ) CreateCalibrationData();
339 CreateTriggerCircuit();
340 CreateTriggerUtilities();
348 if ( es <= fTrackers.GetLast() )
350 tracker =
static_cast<AliTracker*
>(fTrackers.At(es));
364 AliInfo(Form(
"Created tracker %p for recoparam of type %s es=%d",
372 CreateClusterServer(*rp),
378 AliInfo(Form(
"Created (combined) tracker %p for recoparam of type %s es=%d",
383 fTrackers.AddAtAndExpand(tracker,es);
392 AliMUONReconstructor::CreateClusterFinder(
const char* clusterFinderType)
400 TString opt(clusterFinderType);
403 if ( strstr(opt,"PRECLUSTERV2") )
407 else if ( strstr(opt,
"PRECLUSTERV3") )
411 else if ( strstr(opt,
"PRECLUSTER") )
415 else if ( strstr(opt,
"PEAKCOG") )
419 else if ( strstr(opt,
"PEAKFIT") )
423 else if ( strstr(opt,
"COG") )
427 else if ( strstr(opt,
"SIMPLEFITV3") )
431 else if ( strstr(opt,
"SIMPLEFIT") )
435 else if ( strstr(opt,
"MLEM:DRAW") )
439 else if ( strstr(opt,
"MLEMV3") )
443 else if ( strstr(opt,
"MLEMV2") )
447 else if ( strstr(opt,
"MLEM") )
453 AliErrorClass(Form(
"clustering mode \"%s\" does not exist",opt.Data()));
479 if ( !clusterFinder )
return 0x0;
483 AliInfo(Form(
"Created AliMUONSimpleClusterServer (%p) for specie %d with clustering = %s (following requesting clustering mode %s)",
486 fClusterServers.AddAtAndExpand(clusterServer,rp.
GetEventSpecie());
489 return clusterServer;
494 AliMUONReconstructor::CreateCalibrationData()
const 503 if ( !fCalibrationData->IsValid() )
505 AliError(
"Could not retrieve calibrations !");
506 delete fCalibrationData;
507 fCalibrationData = 0x0;
516 Bool_t kTracker(kFALSE);
517 Bool_t kTrigger(kFALSE);
522 AliError(
"Could not get runinfo ?");
527 if (detectors.Contains(
"MUONTRK")) kTracker=kTRUE;
528 if (detectors.Contains(
"MUONTRG")) kTrigger=kTRUE;
531 AliInfo(Form(
"Run with MUON TRIGGER : %s and MUON TRACKER : %s",
532 kTrigger ?
"YES":
"NO" ,
533 kTracker ?
"YES":
"NO"));
538 if ( !fCalibrationData->Pedestals() )
540 AliFatal(Form(
"Could not access all required calibration data (PED %p)",
541 fCalibrationData->Pedestals()));
544 if ( !fCalibrationData->HV() )
548 UInt_t mask = GetRecoParam()->PadGoodnessMask();
550 if ( smask.Contains(
"HV") )
552 AliFatal(
"Could not access all required calibration data (HV)");
556 if ( !fCalibrationData->LV() )
560 UInt_t mask = GetRecoParam()->PadGoodnessMask();
562 if ( smask.Contains(
"LV") )
564 AliFatal(
"Could not access all required calibration data (LV)");
572 AliMUONReconstructor::CreateCalibrator()
const 578 if ( ! fCalibrationData )
579 CreateCalibrationData();
581 AliInfo(
"Calibration will occur.");
583 TString opt(GetOption());
586 if ( strstr(opt,
"NOSTATUSMAP") )
591 Bool_t kTracker(kFALSE);
596 AliError(
"Could not get runinfo ?");
601 if (detectors.Contains(
"MUONTRK")) kTracker=kTRUE;
610 AliWarning(
"Apparently running without MCH so will not instantiante the DigitCalibrator nor read MCH OCDB objects...");
611 fShouldCalibrate=kFALSE;
617 AliMUONReconstructor::ResponseRemovingChambers(AliMUONVTriggerStore* triggerStore)
const 623 if ( ! fCalibrationData )
624 CreateCalibrationData();
626 if ( ! fTriggerProcessor )
629 fTriggerProcessor->ResponseRemovingChambers(*triggerStore);
634 AliMUONReconstructor::DigitStore()
const 639 TString sopt(GetOption());
642 AliInfo(Form(
"Options=%s",sopt.Data()));
644 if ( sopt.Contains(
"DIGITSTOREV1") )
648 else if ( sopt.Contains(
"DIGITSTOREV2R") )
652 else if ( sopt.Contains(
"DIGITSTOREV2S") )
659 AliInfo(Form(
"Will use %s to store digits during reconstruction",fDigitStore->ClassName()));
666 AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore,
667 TTree& clustersTree)
const 685 ResponseRemovingChambers(triggerStore);
686 ok = triggerStore->
Connect(clustersTree,alone);
689 AliError(
"Could not create triggerStore branches in TreeR");
702 TIter next(DigitStore()->CreateIterator());
703 clusterServer->
UseDigits(next,DigitStore());
707 AliDebug(1,Form(
"Doing full clusterization in local reconstruction using %s ",clusterServer->ClassName()));
713 if ( ( i == 6 || i == 7 ) && rp->
BypassSt4() )
continue;
714 if ( ( i == 8 || i == 9 ) && rp->
BypassSt5() )
continue;
716 clusterServer->
Clusterize(i,*fClusterStore,area,rp);
720 Bool_t cok = fClusterStore->Connect(clustersTree,alone);
722 if (!cok)
AliError(
"Could not connect clusterStore to clusterTree");
724 AliDebug(1,Form(
"Number of clusters found = %d",fClusterStore->GetSize()));
734 if (fClusterStore) fClusterStore->Clear();
747 AliMUONReconstructor::HasDigitConversion()
const 752 TString opt(GetOption());
754 if ( opt.Contains(
"SAVEDIGITS" ) && !opt.Contains(
"NOLOCALRECONSTRUCTION") )
777 ConvertDigits(rawReader,DigitStore(),TriggerStore());
779 FillTreeR(TriggerStore(),*clustersTree);
793 if (!digitsTree || !clustersTree)
795 AliError(Form(
"Tree is null : digitsTree=%p clustersTree=%p",
796 digitsTree,clustersTree));
805 AliError(Form(
"Could not get DigitStore from %s",digitsTree->GetName()));
809 AliInfo(Form(
"Created %s from %s",fDigitStore->ClassName(),digitsTree->GetName()));
817 AliError(Form(
"Could not get TriggerStore from %s",digitsTree->GetName()));
821 AliInfo(Form(
"Created %s from %s",fTriggerStore->ClassName(),digitsTree->GetName()));
825 if (!fTriggerStore && !fDigitStore)
827 AliError(
"No store at all. Nothing to do.");
834 fDigitStore->Clear();
835 Bool_t alone = ( fTriggerStore ? kFALSE : kTRUE );
836 Bool_t ok = fDigitStore->Connect(*digitsTree,alone);
839 AliError(
"Could not connect digitStore to digitsTree");
845 fTriggerStore->Clear();
846 Bool_t alone = ( fDigitStore ? kFALSE : kTRUE );
847 Bool_t ok = fTriggerStore->Connect(*digitsTree,alone);
850 AliError(
"Could not connect triggerStore to digitsTree");
855 digitsTree->GetEvent(0);
861 TIter next(fDigitStore->CreateIterator());
863 if (digit && !digit->IsCalibrated())
865 Calibrate(*fDigitStore);
869 FillTreeR(fTriggerStore,*clustersTree);
873 AliMUONVTriggerStore*
874 AliMUONReconstructor::TriggerStore()
const 877 TString sopt(GetOption());
880 if (sopt.Contains(
"TRIGGERDISABLE"))
882 delete fTriggerStore;
892 return fTriggerStore;
static const char * GetEventSpecieName(EventSpecie_t es)
#define AliCodeTimerAutoGeneral(message, counter)
Reading Raw data class for trigger and tracker chambers.
Interface of a cluster finder.
Bool_t BypassSt4() const
return kTRUE if we should replace clusters in St 4 by generated clusters from trigger tracks ...
#define StdoutToAliDebug(level, whatever)
virtual Int_t Clusterize(Int_t chamberId, AliMUONVClusterStore &clusterStore, const AliMpArea &area, const AliMUONRecoParam *recoParam=0x0)=0
Find and add clusters from a given region of a given chamber to the store.
Interface for a digit container.
Implementation of AliMUONVTriggerStore.
static AliMpSegmentation * Instance(Bool_t warn=true)
static const AliDetectorRecoParam * GetRecoParam(Int_t iDet)
Interface of a cluster finder for combined tracking.
void CombineClusterTrackReco(Bool_t flag)
switch on/off the combined cluster/track reconstruction
static Bool_t LoadDDLStore(Bool_t warn=false)
A rectangle area positioned in plane..
Option_t * GetClusteringMode() const
get the clustering (pre-clustering) mode
Class with MUON reconstruction parameters.
Utilities for trigger (check if pad is masked)
Implementation of VClusterStore.
Base class of a trigger information store.
#define AliWarning(message)
void Reconstruct(bool raw=false)
Manager class for muon trigger electronics.
#define AliErrorClass(message)
static AliMpDDLStore * Instance(Bool_t warn=true)
A basic pre-cluster finder.
virtual AliMUONVDigitStore * Create() const =0
Create an (empty) object of the same concrete class as *this.
virtual AliMUONVStore * Create() const =0
Create an empty copy of this.
Implementation of AliMUONVClusterServer interface.
Class to calibrate the digits.
static Int_t GetDetIndex(const char *detector)
#define AliCodeTimerStart(message)
#define AliCodeTimerAuto(message, counter)
A very basic (and mostly useless, probably) cluster finder.
static TString AsCondition(Int_t status)
Bool_t BypassSt5() const
return kTRUE if we should replace clusters in St 5 by generated clusters from trigger tracks ...
A basic pre-cluster finder.
#define AliFatal(message)
void UnloadFromCache(const char *path)
#define AliDebug(logLevel, message)
Single entry point to access MUON calibration data.
Implementation of AliReconstructor for MUON (both tracker and trigger)
const char * GetActiveDetectors() const
static EventSpecie_t Convert(Int_t ies)
#define AliError(message)
virtual void UseDigits(TIter &next, AliMUONVDigitStore *digitStore=0x0)=0
Specify an iterator to loop over the digits needed to perform our job.
A basic pre-cluster finder.
Cluster finder in MUON arm of ALICE.
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
static Int_t NofTrackingChambers()
Return number of tracking chambers.
void UseChamber(Int_t iCh, Bool_t flag)
switch on/off a chamber in the reconstruction
Cluster finder in MUON arm of ALICE.
Cluster finder in MUON arm of ALICE.
#define AliCodeTimerStop(message)
Int_t GetEventSpecie() const