continue;
if (!clust->IsEMCAL())
continue;
-
if (fEMCALRecoUtils->ClusterContainsBadChannel(fEMCALGeo, clust->GetCellsAbsId(), clust->GetNCells())) {
delete clusArr->RemoveAt(icluster);
continue; //todo is it really needed to remove it? Or should we flag it?
}
}
- fEMCALRecoUtils->CorrectClusterEnergyLinearity(clust);
if(fRecalDistToBadChannels)
fEMCALRecoUtils->RecalculateClusterDistanceToBadChannel(fEMCALGeo, cells, clust);
if(fReCalibCluster)
fEMCALRecoUtils->RecalibrateClusterEnergy(fEMCALGeo, clust, cells);
if(fRecalClusPos)
fEMCALRecoUtils->RecalculateClusterPosition(fEMCALGeo, cells, clust);
+
+ Float_t correctedEnergy = fEMCALRecoUtils->CorrectClusterEnergyLinearity(clust);
+ clust->SetE(correctedEnergy);
+
}
-
+
+
clusArr->Compress();
// Track matching
fEMCALRecoUtils->FindMatches(event,0x0,fEMCALGeo);
- SetClusterMatchedToTrack(event);
- SetTracksMatchedToCluster(event);
-
-}
-
-//_____________________________________________________
-void AliEMCALTenderSupply::SetClusterMatchedToTrack(AliESDEvent *event)
-{
- // Checks if tracks are matched to EMC clusters and set the matched EMCAL cluster index to ESD track.
-
- Int_t nTracks = event->GetNumberOfTracks();
- for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
- AliESDtrack* track = event->GetTrack(iTrack);
- if (!track) {
- AliWarning(Form("Could not receive track %d", iTrack));
- continue;
- }
- Int_t matchClusIndex = fEMCALRecoUtils->GetMatchedClusterIndex(iTrack);
- track->SetEMCALcluster(matchClusIndex); //sets -1 if track not matched within residual
- if(matchClusIndex != -1)
- track->SetStatus(AliESDtrack::kEMCALmatch);
- else
- track->ResetStatus(AliESDtrack::kEMCALmatch);
- }
- if (fDebugLevel>2)
- AliInfo("Track matched to closest cluster");
-}
-
-//_____________________________________________________
-void AliEMCALTenderSupply::SetTracksMatchedToCluster(AliESDEvent *event)
-{
- // Checks if EMC clusters are matched to ESD track.
- // Adds track indexes of all the tracks matched to a cluster withing residuals in ESDCalocluster.
-
- for (Int_t iClus=0; iClus < event->GetNumberOfCaloClusters(); ++iClus) {
- AliESDCaloCluster *cluster = event->GetCaloCluster(iClus);
- if (!cluster->IsEMCAL())
- continue;
-
- Int_t nTracks = event->GetNumberOfTracks();
- TArrayI arrayTrackMatched(nTracks);
-
- // Get the closest track matched to the cluster
- Int_t nMatched = 0;
- Int_t matchTrackIndex = fEMCALRecoUtils->GetMatchedTrackIndex(iClus);
- if (matchTrackIndex != -1) {
- arrayTrackMatched[nMatched] = matchTrackIndex;
- nMatched++;
- }
-
- // Get all other tracks matched to the cluster
- for(Int_t iTrk=0; iTrk<nTracks; ++iTrk) {
- AliESDtrack* track = event->GetTrack(iTrk);
- if(iTrk == matchTrackIndex) continue;
- if(track->GetEMCALcluster() == iClus){
- arrayTrackMatched[nMatched] = iTrk;
- ++nMatched;
- }
- }
-
- arrayTrackMatched.Set(nMatched);
- cluster->AddTracksMatched(arrayTrackMatched);
-
- Float_t eta= -999, phi = -999;
- if (matchTrackIndex != -1)
- fEMCALRecoUtils->GetMatchedResiduals(iClus, eta, phi);
- cluster->SetTrackDistance(phi, eta);
- }
+ fEMCALRecoUtils->SetClusterMatchedToTrack(event);
+ fEMCALRecoUtils->SetTracksMatchedToCluster(event);
- if (fDebugLevel>2)
- AliInfo("Cluster matched to tracks");
}
//_____________________________________________________
TObjArray *mobj = 0;
if(fMisalignSurvey == kdefault){ //take default alignment corresponding to run no
+ printf("***DEFAULT MATRICES***\n!");
AliOADBContainer emcalgeoCont(Form("emcal"));
emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
mobj=(TObjArray*)emcalgeoCont.GetObject(runGM,"EmcalMatrices");
}
}
- if(fMisalignSurvey == kSurveybyS){ //take alignment at module level
+ if(fMisalignSurvey == kSurveybyM){ //take alignment at module level
if (runGM <= 140000) { //2010 data
AliOADBContainer emcalgeoCont(Form("emcal2010"));
emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
mobj=(TObjArray*)emcalgeoCont.GetObject(100,"survey10");
} else if (runGM>140000) { // 2011 LHC11a pass1 data
+
AliOADBContainer emcalgeoCont(Form("emcal2011"));
emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
mobj=(TObjArray*)emcalgeoCont.GetObject(100,"survey11byM");
void UpdateCells();
- void SetClusterMatchedToTrack (AliESDEvent *event);
-
- void SetTracksMatchedToCluster(AliESDEvent *event);
-
void UpdateClusters();
AliEMCALGeometry *fEMCALGeo; //! EMCAL geometry
fPIDUtils(), fAODFilterMask(32),
fMatchedTrackIndex(0x0), fMatchedClusterIndex(0x0),
fResidualEta(0x0), fResidualPhi(0x0), fCutEtaPhiSum(kTRUE), fCutEtaPhiSeparate(kFALSE),
- fCutR(0.1), fCutEta(0.025), fCutPhi(0.05),
+ fCutR(0.05), fCutEta(0.025), fCutPhi(0.05),
fClusterWindow(100), fMass(0.139),
fStepSurface(10.), fStepCluster(5.),
fTrackCutsType(kLooseCut), fCutMinTrackPt(0), fCutMinNClusterTPC(-1),
}
Float_t energy = cluster->E();
-
+
switch (fNonLinearityFunction) {
case kPi0MC:
break;
}
-
+
return energy;
}
AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
-
+
TObjArray *clusterArray = 0x0;
if(!clusterArr)
{
}
}
+
+//__________________________________________________________________
+void AliEMCALRecoUtils::SetClusterMatchedToTrack(AliESDEvent *event)
+{
+ // Checks if tracks are matched to EMC clusters and set the matched EMCAL cluster index to ESD track.
+
+ Int_t nTracks = event->GetNumberOfTracks();
+ for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
+ AliESDtrack* track = event->GetTrack(iTrack);
+ if (!track) {
+ AliWarning(Form("Could not receive track %d", iTrack));
+ continue;
+ }
+ Int_t matchClusIndex = GetMatchedClusterIndex(iTrack);
+ track->SetEMCALcluster(matchClusIndex); //sets -1 if track not matched within residual
+ if(matchClusIndex != -1)
+ track->SetStatus(AliESDtrack::kEMCALmatch);
+ else
+ track->ResetStatus(AliESDtrack::kEMCALmatch);
+ }
+ AliDebug(2,"Track matched to closest cluster");
+}
+
+//_________________________________________________________________
+void AliEMCALRecoUtils::SetTracksMatchedToCluster(AliESDEvent *event)
+{
+ // Checks if EMC clusters are matched to ESD track.
+ // Adds track indexes of all the tracks matched to a cluster withing residuals in ESDCalocluster.
+
+ for (Int_t iClus=0; iClus < event->GetNumberOfCaloClusters(); ++iClus) {
+ AliESDCaloCluster *cluster = event->GetCaloCluster(iClus);
+ if (!cluster->IsEMCAL())
+ continue;
+
+ Int_t nTracks = event->GetNumberOfTracks();
+ TArrayI arrayTrackMatched(nTracks);
+
+ // Get the closest track matched to the cluster
+ Int_t nMatched = 0;
+ Int_t matchTrackIndex = GetMatchedTrackIndex(iClus);
+ if (matchTrackIndex != -1) {
+ arrayTrackMatched[nMatched] = matchTrackIndex;
+ nMatched++;
+ }
+
+ // Get all other tracks matched to the cluster
+ for(Int_t iTrk=0; iTrk<nTracks; ++iTrk) {
+ AliESDtrack* track = event->GetTrack(iTrk);
+ if(iTrk == matchTrackIndex) continue;
+ if(track->GetEMCALcluster() == iClus){
+ arrayTrackMatched[nMatched] = iTrk;
+ ++nMatched;
+ }
+ }
+
+ //printf("Tender::SetTracksMatchedToCluster - cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]);
+
+ arrayTrackMatched.Set(nMatched);
+ cluster->AddTracksMatched(arrayTrackMatched);
+
+ Float_t eta= -999, phi = -999;
+ if (matchTrackIndex != -1)
+ GetMatchedResiduals(iClus, eta, phi);
+ cluster->SetTrackDistance(phi, eta);
+ }
+
+ AliDebug(2,"Cluster matched to tracks");
+}
+
+
//___________________________________________________
void AliEMCALRecoUtils::Print(const Option_t *) const
{
class AliVCluster;
class AliVCaloCells;
class AliVEvent;
+#include "AliESDEvent.h"
// EMCAL includes
class AliEMCALGeometry;
static Bool_t ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, Double_t emcalR, Double_t mass, Double_t step, Float_t &eta, Float_t &phi);
static Bool_t ExtrapolateTrackToPosition(AliExternalTrackParam *trkParam, Float_t *clsPos, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
- static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
- Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, AliVCluster *cluster, Float_t &tmpEta, Float_t &tmpPhi);
+ static Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
+ Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, Float_t &tmpEta, Float_t &tmpPhi);
UInt_t FindMatchedPosForCluster(Int_t clsIndex) const;
UInt_t FindMatchedPosForTrack(Int_t trkIndex) const;
Bool_t IsClusterMatched(Int_t clsIndex) const;
Bool_t IsTrackMatched(Int_t trkIndex) const;
+ void SetClusterMatchedToTrack (AliESDEvent *event);
+
+ void SetTracksMatchedToCluster(AliESDEvent *event);
void SwitchOnCutEtaPhiSum() { fCutEtaPhiSum = kTRUE ;
fCutEtaPhiSeparate = kFALSE ; }