17 #include <TClonesArray.h> 18 #include "TGeoManager.h" 19 #include "TGeoMatrix.h" 45 #include "AliRawReader.h" 89 : fGeom(0),fCalibData(0),fCalibTime(0),fPedestalData(0), fMatches(0x0), fESDCalofriend(0x0)
114 AliInfo(Form(
"Finding EMCAL Geometry from run number %d.",runNumber));
120 AliWarning(Form(
"Using default geometry in reconstruction!!!"));
125 else AliInfo (Form(
"Geometry name: <<%s>>",
fGeom->GetName()));
147 AliFatal(
"Energy Calibration parameters not found in CDB!");
159 AliFatal(
"Time Calibration parameters not found in CDB!");
170 AliFatal(
"Dead map not found in CDB!");
175 fgTriggerData =
new TClonesArray(
"AliEMCALTriggerData",dsize);
176 for (
int i=0;i<dsize;i++) {
183 fgDigitsArr =
new TClonesArray(
"AliEMCALDigit",1000);
187 fgTriggerDigits =
new TClonesArray(
"AliEMCALTriggerRawDigit", kNTRU * 96);
262 AliFatal(
"No trigger configuration found in OCDB");
275 Int_t clusterizerType = -1;
276 Int_t eventType = -1;
335 AliFatal(Form(
"Unknown clusterizer %d ", clusterizerType));
374 clustersTree->Fill();
399 TClonesArray *digitsTrg =
new TClonesArray(
"AliEMCALTriggerRawDigit", kNTRU * 96);
401 Int_t bufsize = 32000;
402 digitsTree->Branch(
"EMCAL", &
fgDigitsArr, bufsize);
403 digitsTree->Branch(
"EMTRG", &digitsTrg, bufsize);
406 Bool_t doFit = kTRUE;
437 AliDebug(1,
" Calibration Event, skip!");
461 static int saveOnce[2] = {0,0};
464 Int_t v0M[2] = {0, 0};
475 AliWarning(
"No V0 ESD! Run trigger processor w/ null V0 charges");
480 TBranch *branchtrg = digitsTree->GetBranch(
"EMTRG");
484 AliError(
"Can't get the branch with the EMCAL trigger digits!");
489 branchtrg->GetEntry(0);
509 Int_t px, py, trgBitWord=0;
511 Int_t a = -1, t = -1, times[10];
520 const Int_t nSamples = 64;
521 Int_t samples[nSamples]={0};
532 for (
int j=0;j<2;j++) {
568 Int_t nDigits =
fgDigitsArr->GetEntries(), idignew = 0 ;
569 AliDebug(1,Form(
"%d digits",nDigits));
577 Int_t mapDigitAndCellIndex[20000] = { 0 } ;
579 for (Int_t idig = 0 ; idig < nDigits ; idig++)
585 if (energy <= 0 ) continue ;
589 if (energy <= 0 ) continue ;
599 for ( Int_t jndex = 0 ; jndex < nparents ; jndex++ )
608 Bool_t highGain = kFALSE;
611 emcCells.
SetCell(idignew,dig->
GetId(),energy, time,digLabel,0.,highGain);
613 const Int_t nSamples = 64;
614 Int_t samples[nSamples]={0};
621 for (
int idig=0;idig<nSamples;idig++) samples[idig]=0;
627 mapDigitAndCellIndex[idignew] = idig;
638 clustersTree->SetBranchStatus(
"*",0);
639 clustersTree->SetBranchStatus(
"EMCALECARP",1);
641 TBranch *branch = clustersTree->GetBranch(
"EMCALECARP");
646 Int_t nClusters =
fgClustersArr->GetEntries(), nClustersNew=0;
647 AliDebug(1,Form(
"%d clusters",nClusters));
653 for (Int_t iClust = 0 ; iClust < nClusters ; iClust++)
665 for (Int_t ixyz=0; ixyz<3; ixyz++)
666 xyz[ixyz] = gpos[ixyz];
674 Int_t *digitInts = clust->
GetAbsId();
675 TArrayS absIdList(cellMult);
676 TArrayD fracList(cellMult);
678 Int_t newCellMult = 0;
679 for (Int_t iCell=0; iCell<cellMult; iCell++)
681 if (amplFloat[iCell] > 0)
683 absIdList[newCellMult] = (UShort_t)(digitInts[iCell]);
687 fracList[newCellMult] = amplFloat[iCell]/(emcCells.
GetCellAmplitude(digitInts[iCell]));
689 fracList[newCellMult] = 0;
695 absIdList.Set(newCellMult);
696 fracList.Set(newCellMult);
720 ec->
SetM02(elipAxis[0]*elipAxis[0]) ;
721 ec->
SetM20(elipAxis[1]*elipAxis[1]) ;
727 Int_t parentMult = 0;
728 Int_t *parentList = clust->
GetParents(parentMult);
731 ec->
SetLabel(parentList,parentMult);
740 UShort_t *newAbsIdList =
new UShort_t[newCellMult];
741 Double_t *newFracList =
new Double_t[newCellMult];
742 UInt_t *cellEDepFrac =
new UInt_t [newCellMult];
744 for(Int_t i = 0; i < newCellMult ; i++)
747 newAbsIdList[i] = absIdList[i];
748 newFracList [i] = fracList[i];
756 Int_t idigit = mapDigitAndCellIndex[cellPos];
766 Float_t edepTot = 0 ;
767 Float_t mcEDepFrac[4] = {0,0,0,0};
769 for ( Int_t jndex = 0 ; jndex < nparents ; jndex++ )
775 if ( digLabel == parentList[0] ) mcEDepFrac[0] = edep;
776 else if ( digLabel == parentList[1] ) mcEDepFrac[1] = edep;
777 else if ( digLabel == parentList[2] ) mcEDepFrac[2] = edep;
778 else if ( digLabel == parentList[3] ) mcEDepFrac[3] = edep;
788 for(Int_t idep = 0; idep < 4; idep++)
789 mcEDepFrac[idep] /= edepTot;
806 for (Int_t itrack = 0; itrack < nTracks; itrack++)
811 Float_t dEta=-999,
dPhi=-999;
829 Int_t nMatch =
fMatches->GetEntries();
830 TArrayI arrayTrackMatched(nMatch);
831 for(Int_t imatch=0; imatch<nMatch; imatch++)
834 arrayTrackMatched[imatch] = match->
GetIndexT();
847 delete [] newAbsIdList ;
848 delete [] newFracList ;
849 delete [] cellEDepFrac ;
858 for(Int_t icl=0; icl<ncls; icl++)
861 if(!cluster || !cluster->
IsEMCAL())
continue;
863 for(Int_t itr=0; itr<trackIndex->GetSize(); itr++)
884 AliDebug(1, Form(
"Writing Calo friend data to ESD tree"));
906 AliError(
"Can not store misal. matrixes: no gGeoManager! \n") ;
911 const Int_t bufsize = 255;
913 TGeoHMatrix * m = 0x0;
935 snprintf(path,bufsize,
"/ALIC_1/XEN1_1/%s_%d", SMName.Data(), SMOrder) ;
969 fgDigitsArr =
new TClonesArray(
"AliEMCALDigit",100);
973 TBranch *branch = digitsTree->GetBranch(
"EMCAL");
976 AliError(
"can't get the branch with the EMCAL digits !");
993 dEta = -999, dPhi = -999;
994 Bool_t ITSTrackSA = 0;
999 if(friendTrack && friendTrack->
GetTPCOut())
1000 trkParam = const_cast<AliExternalTrackParam*>(friendTrack->
GetTPCOut());
1002 trkParam = const_cast<AliExternalTrackParam*>(track->
GetInnerParam());
1008 if(!trkParam)
return kFALSE;
1013 if(ITSTrackSA)
delete trkParam;
1017 if(ITSTrackSA)
delete trkParam;
1053 if (&source ==
this)
return *
this;
1070 if (thisDist > thatDist)
return 1;
1071 else if (thisDist < thatDist)
return -1;
AliEMCALCalibData * fCalibData
! Access to OCDB energy calibration database if available
static AliRunLoader * Instance()
AliESDCaloCluster * GetCaloCluster(Int_t i) const
virtual void FillESD(TTree *digitsTree, TTree *clustersTree, AliESDEvent *esd) const
virtual void Calibrate(Float_t &, Float_t &time, const Int_t cellId)
void InitTriggerElectronics() const
Init the fgTriggerProcessor.
virtual ~AliEMCALReconstructor()
void Print(Option_t *opt="") const
Print the list of timers we manage.
void RunPID(AliESDEvent *esd)
void SetdEta(Double_t dEta)
virtual void Digits2Clusters(Option_t *option)=0
TList * fMatches
! Collection of matches between tracks and clusters
AliESDVZERO * GetVZEROData() const
Float_t GetDEParent(Int_t index) const
void SetM02(Double_t m02)
virtual void Digits2Trigger(TClonesArray *digits, const Int_t V0M[], AliEMCALTriggerData *data)
Digits to trigger.
Bool_t Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts, Int_t trgbits)
const AliExternalTrackParam * GetInnerParam() const
Bool_t CalculateResidual(AliESDtrack *track, AliESDCaloCluster *cluster, Float_t &dEta, Float_t &dPhi) const
void AddTracksMatched(TArrayI &array)
static AliEMCALClusterizer * fgClusterizer
Access to the clusterization tools.
Float_t GetTime(void) const
EMCal trigger raw digits.
virtual Float_t * GetParentsDE() const
TArrayI * GetTracksMatched() const
static const AliEMCALRecParam * GetRecParam()
static const Char_t * GetDefaultGeometryName()
void SetDistance(Double_t dist)
virtual void ConvertDigits(AliRawReader *rawReader, TTree *digitsTree) const
virtual void Print(const Option_t *opt) const
Dump raw digit info.
Int_t GetEMCALcluster() const
static TObjArray * fgClustersArr
Temporary array with clusters, to be reused in the event.
Bool_t GetMaximum(Int_t &litude, Int_t &time) const
Checks the maximum amplitude in the time sample.
Double_t fDistance
Track - cluster distance.
virtual Float_t GetDispersion() const
void SetRemoveBadChannels(Bool_t val)
void SetCellsAbsId(UShort_t *array)
void SetEMCALMatrix(TGeoHMatrix *matrix, Int_t i)
void SetReconstructor(Bool_t yesno)
Double_t fdEta
Track - cluster residual in eta.
static TClonesArray * fgDigitsArr
Temporary array with digits, to be reused in the event.
static const AliEMCALRecParam * fgkRecParam
Access to OCDB reconstruction parameters.
AliESDCalofriend * fESDCalofriend
void SetType(Char_t type)
virtual Float_t GetEnergy() const
Int_t GetNumberOfSuperModules(void) const
virtual void SetOutput(TTree *clustersTree)
Set the tree with output clusters.
static AliEMCALGeometry * GetInstanceFromRunNumber(Int_t runNumber, TString geoName="", const Text_t *mcname="TGeant3", const Text_t *mctitle="")
Cell energy calibration factors container class.
AliCaloCalibPedestal * fPedestalData
! Access to OCDB tower status database if available
Int_t GetTriggerBits() const
Int_t AddCaloCluster(const AliESDCaloCluster *c)
virtual UShort_t GetTriggerChargeC() const
void CreateContainer(Short_t nCells)
Container of reconstruction parameters.
Int_t GetFittingAlgorithm() const
Double_t GetExtrapolateStep() const
const AliEMCALTriggerDCSConfig * GetTriggerDCSConfig()
Get DCS config.
void GetALTROSamplesHG(Int_t samples[64]) const
Int_t GetIparent(Int_t index) const
#define AliWarning(message)
Clusterize neighbour cells, split if several maxima.
Short_t GetNExMax(void) const
EMCal trigger electronics manager L0/L1.
void SetFALTROUsage(Bool_t val)
Int_t GetNALTROSamplesHG() const
void SetNPedSamples(Int_t val)
Int_t GetNTotalTRU() const
AliCDBEntry * Get(const AliCDBId &query, Bool_t forceCaching=kFALSE)
void Allocate(Int_t size)
Int_t GetNALTROSamplesLG() const
void SetOption(const Option_t *opt)
void SetCaloTriggerType(const Int_t *type)
Int_t Compare(const TObject *obj) const
Int_t GetMultiplicity(void) const
virtual void Reconstruct(TTree *digitsTree, TTree *clustersTree) const
void SetMedian(Int_t i, Int_t m)
Bool_t Add(Int_t id, Int_t type, Int_t nsamples, Int_t samples[])
void SetNoiseThreshold(Int_t val)
void SetDispersion(Double_t disp)
static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, const AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi)
void SetTriggerBitWord(Int_t w)
void SetChi2(Double_t chi2)
const AliExternalTrackParam * GetTPCOut() const
void GetALTROSamplesLG(Int_t samples[64]) const
AliESDCaloTrigger * GetCaloTrigger(TString calo) const
void Allocate(Int_t size)
virtual void InitClusterizer() const
void ReadDigitsArrayFromTree(TTree *digitsTree) const
void SetL1FrameMask(Int_t m)
AliESDCaloCells * GetEMCALCells() const
Container with calorimeter trigger information in the ESD event.
Int_t fIndexT
Track index in 'fTracks' array.
Int_t GetL1TimeSum() const
Short_t GetClusterizerFlag() const
void SetM20(Double_t m20)
#define AliCodeTimerAuto(message, counter)
TGeoManager * gGeoManager
void SetTrackDistance(Double_t dx, Double_t dz)
virtual Option_t * GetOption() const
AliEMCALCalibTime * fCalibTime
! Access to OCDB time calibration database if available
Float_t * GetEnergiesList() const
void SetClusterMCEdepFractionFromEdepArray(Float_t *array)
virtual void SetInput(TTree *digitsTree)
Read the digits from the input tree.
virtual AliEMCALGeometry * GetGeometry() const
Double_t GetCellAmplitude(Short_t cellNumber)
Int_t GetSMType(Int_t nSupMod) const
Double_t GetMass(Bool_t tpcOnly=kFALSE) const
Cell time shifts container class.
TObject * FindListObject(const char *name) const
static AliCodeTimer * Instance()
Unique instance of this class, which is a singleton.
Base Class for EMCAL description.
Clusterize neighbour cells, no split, unfolding possible.
AliEMCALGeometry * fGeom
Not implemented.
Calorimeter cluster data container.
pedestal/bad map monitoring and calibration tools
static AliEMCALTriggerDCSConfigDB * Instance()
static TClonesArray * fgTriggerDigits
Temporary array with trigger digits, to be reused in the event.
#define AliFatal(message)
void Raw2Digits(AliRawReader *reader, TClonesArray *digitsArr, const AliCaloCalibPedestal *pedbadmap, TClonesArray *digitsTRG=0x0, TClonesArray *trgData=0x0)
static AliEMCALRawUtils * fgRawUtils
Access to raw fitting tools.
void SetNExMax(UChar_t nExMax)
static TClonesArray * fgTriggerData
Trigger parameters data container.
virtual UShort_t GetTriggerChargeA() const
Int_t GetL1SubRegion() const
void SetFittingAlgorithm(Int_t val)
Create clusters of maximum size NxM.
Int_t GetNSamples() const
Bool_t GetSamples(Int_t samples[64], Int_t ns) const
void SetEMCALcluster(Int_t index)
Int_t GetTriggerMappingVersion() const
#define AliDebug(logLevel, message)
virtual void GetGlobalPosition(TVector3 &gpos) const
void SetCalofriend(AliESDCalofriend *obj)
void SetL1PhaseUsage(Bool_t val)
virtual Int_t * GetParents(Int_t &number) const
virtual void InitParameters()
Initializes the parameters for the Clusterizer from AliEMCALReconstructor::GetRecParam().
Float_t GetDistanceToBadTower() const
virtual const char * Version() const
Bool_t SetCell(Short_t pos, Short_t cellNumber, Double_t amplitude, Double_t time, Int_t mclabel=-1, Double_t efrac=0., Bool_t isHG=kFALSE)
void SetL1V0(const Int_t *v)
Int_t GetNumberOfTracks() const
void SetLabel(Int_t *array, UInt_t size)
AliESDtrack * GetTrack(Int_t i) const
const TGeoHMatrix * GetEMCALMatrix(Int_t i) const
const AliESDfriendTrack * GetFriendTrack() const
Compute cluster PID weights.
UInt_t PackMCEdepFraction(Float_t *eDep) const
void SetL1Threshold(Int_t i, Int_t thr)
void SetdPhi(Double_t dPhi)
Int_t GetNumberOfCaloClusters() const
AliDetector * GetDetector(const char *name) const
Float_t GetTime(void) const
#define AliError(message)
Bool_t GetL0Times(Int_t times[]) const
Get L0 times.
static AliEMCALGeometry * GetInstance()
Int_t GetNiparent() const
void SetCellsAmplitudeFraction(Double32_t *array)
Class for calorimeter cell ESD data handling.
Clusterize neighbour cells, split if several maxima.
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
Bool_t GetPositionInEMCALFromAbsFastORIndex(const Int_t id, Int_t &iEta, Int_t &iPhi) const
void FillMisalMatrixes(AliESDEvent *esd) const
Short_t GetCellPosition(Short_t cellNumber)
void SetCellsMCEdepFractionMap(UInt_t *array)
Double_t fdPhi
Track - cluster residual in phi.
Float_t GetAmplitude() const
void SetPosition(Float_t *x)
Int_t GetNL0Times() const
void SetNumberOfCells(Int_t n)
virtual void GetElipsAxis(Float_t *lambda) const
void SetDistanceToBadChannel(Double_t dist)
virtual void DeleteRecPoints()
Free the cluster array.
Base class for the clusterization algorithm (pure abstract)
AliRun * GetAliRun() const
Wrapping class for EMCal reconstruction.
void SetIndexT(Int_t itr)
static AliEMCALTriggerElectronics * fgTriggerProcessor
Trigger preprocessor.
Int_t GetEventSpecie() const
void SetTOF(Double_t tof)