fDeltaAODFileName("deltaAODPartCorr.root"),fFiredTriggerClassName(""),
fAnaLED(kFALSE),fTaskName(""),fCaloUtils(0x0),
fMixedEvent(NULL), fNMixedEvent(1), fVertex(NULL),
- fWriteOutputDeltaAOD(kFALSE),fOldAOD(kFALSE),fCaloFilterPatch(kFALSE)
+ fWriteOutputDeltaAOD(kFALSE),fOldAOD(kFALSE),fCaloFilterPatch(kFALSE),
+ fEMCALClustersListName("")
{
//Ctor
//
}
- //____________________________________________________________________________
+//____________________________________________________________________________
+void AliCaloTrackReader::FillInputEMCALAlgorithm(AliVCluster * clus, const Int_t iclus) {
+ //Fill the EMCAL data in the array, do it
+
+ Int_t vindex = 0 ;
+ if (fMixedEvent)
+ vindex = fMixedEvent->EventIndexForCaloCluster(iclus);
+
+ //Check if the cluster contains any bad channel and if close to calorimeter borders
+ if(GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells()))
+ return;
+ if(!GetCaloUtils()->CheckCellFiducialRegion(clus, (AliVCaloCells*)fInputEvent->GetEMCALCells(), fInputEvent, vindex))
+ return;
+
+ TLorentzVector momentum ;
+
+ clus->GetMomentum(momentum, fVertex[vindex]);
+
+ if(fEMCALPtMin < momentum.Pt()){
+
+ if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"EMCAL"))
+ return;
+
+ if(fDebug > 2 && momentum.E() > 0.1)
+ printf("AliCaloTrackReader::FillInputEMCAL() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
+ momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
+
+ //Float_t pos[3];
+ //clus->GetPosition(pos);
+ //printf("Before Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]);
+
+ //Recalibrate the cluster energy
+ if(GetCaloUtils()->IsRecalibrationOn()) {
+ Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, GetEMCALCells());
+ clus->SetE(energy);
+ //printf("Recalibrated Energy %f\n",clus->E());
+ GetCaloUtils()->RecalculateClusterShowerShapeParameters(GetEMCALCells(),clus);
+ GetCaloUtils()->RecalculateClusterPID(clus);
+
+ }
+
+ //Recalculate distance to bad channels, if new list of bad channels provided
+ GetCaloUtils()->RecalculateClusterDistanceToBadChannel(GetEMCALCells(),clus);
+
+ //Recalculate cluster position
+ if(GetCaloUtils()->IsRecalculationOfClusterPositionOn()){
+ GetCaloUtils()->RecalculateClusterPosition(GetEMCALCells(),clus);
+ //clus->GetPosition(pos);
+ //printf("After Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]);
+ }
+
+ //Correct non linearity
+ if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()){
+ GetCaloUtils()->CorrectClusterEnergy(clus) ;
+ //printf("Linearity Corrected Energy %f\n",clus->E());
+ }
+
+ if (fMixedEvent)
+ clus->SetID(iclus) ;
+
+ fAODEMCAL->Add(clus);
+ }
+}
+
+//____________________________________________________________________________
void AliCaloTrackReader::FillInputEMCAL() {
//Return array with EMCAL clusters in aod format
if(fDebug > 2 ) printf("AliCaloTrackReader::FillInputEMCAL()\n");
//Loop to select clusters in fiducial cut and fill container with aodClusters
- Int_t nclusters = fInputEvent->GetNumberOfCaloClusters();
- for (Int_t iclus = 0; iclus < nclusters; iclus++) {
- AliVCluster * clus = 0;
- if ( (clus = fInputEvent->GetCaloCluster(iclus)) ) {
- if (IsEMCALCluster(clus)){
-
- //Check if the cluster contains any bad channel and if close to calorimeter borders
- Int_t vindex = 0 ;
- if (fMixedEvent)
- vindex = fMixedEvent->EventIndexForCaloCluster(iclus);
-
- if(GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells()))
- continue;
- if(!GetCaloUtils()->CheckCellFiducialRegion(clus, (AliVCaloCells*)fInputEvent->GetEMCALCells(), fInputEvent, vindex))
- continue;
-
- TLorentzVector momentum ;
-
- clus->GetMomentum(momentum, fVertex[vindex]);
-
- if(fEMCALPtMin < momentum.Pt()){
-
- if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"EMCAL"))
- continue;
-
- if(fDebug > 2 && momentum.E() > 0.1)
- printf("AliCaloTrackReader::FillInputEMCAL() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- //Float_t pos[3];
- //clus->GetPosition(pos);
- //printf("Before Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]);
-
- //Recalibrate the cluster energy
- if(GetCaloUtils()->IsRecalibrationOn()) {
- Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, GetEMCALCells());
- clus->SetE(energy);
- //printf("Recalibrated Energy %f\n",clus->E());
- GetCaloUtils()->RecalculateClusterShowerShapeParameters(GetEMCALCells(),clus);
- GetCaloUtils()->RecalculateClusterPID(clus);
-
- }
-
- //Recalculate distance to bad channels, if new list of bad channels provided
- GetCaloUtils()->RecalculateClusterDistanceToBadChannel(GetEMCALCells(),clus);
-
- //Recalculate cluster position
- if(GetCaloUtils()->IsRecalculationOfClusterPositionOn()){
- GetCaloUtils()->RecalculateClusterPosition(GetEMCALCells(),clus);
- //clus->GetPosition(pos);
- //printf("After Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]);
- }
-
- //Correct non linearity
- if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()){
- GetCaloUtils()->CorrectClusterEnergy(clus) ;
- //printf("Linearity Corrected Energy %f\n",clus->E());
- }
-
- if (fMixedEvent) {
- clus->SetID(iclus) ;
- }
-
- fAODEMCAL->Add(clus);
-
- }//Pt and Fiducial cut passed.
- }//EMCAL cluster
- }// cluster exists
- }// cluster loop
+ if(fEMCALClustersListName==""){
+ Int_t nclusters = fInputEvent->GetNumberOfCaloClusters();
+ for (Int_t iclus = 0; iclus < nclusters; iclus++) {
+ AliVCluster * clus = 0;
+ if ( (clus = fInputEvent->GetCaloCluster(iclus)) ) {
+ if (IsEMCALCluster(clus)){
+ FillInputEMCALAlgorithm(clus, iclus);
+ }//EMCAL cluster
+ }// cluster exists
+ }// cluster loop
+ }//Get the clusters from the input event
+ else {
+ TClonesArray * clusterList = dynamic_cast<TClonesArray*> (fOutputEvent->FindListObject(fEMCALClustersListName));
+ if(!clusterList){
+ printf("AliCaloTrackReader::FillInputEMCAL() - Wrong name of list with clusters? <%s>\n",fEMCALClustersListName.Data());
+ return;
+ }
+ Int_t nclusters = clusterList->GetEntriesFast();
+ for (Int_t iclus = 0; iclus < nclusters; iclus++) {
+ AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
+ //printf("E %f\n",clus->E());
+ FillInputEMCALAlgorithm(clus, iclus);
+ }// cluster loop
+ }
//Recalculate track matching
GetCaloUtils()->RecalculateClusterTrackMatching(fInputEvent);