}
fClusterizer->Digits2Clusters("");
+
if (fSubBackground) {
if (fCalibData) {
fClusterizer->SetInputCalibrated(kFALSE);
Int_t cellMCLabel=-1;
if (fCaloCells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
break;
-
- if ((fInputCellType == kFEEDataMCOnly && cellMCLabel <= 0) ||
- (fInputCellType == kFEEDataExcludeMC && cellMCLabel > 0))
- continue;
+
+ if (fInputCellType == kFEEDataMCOnly) {
+ if (cellMCLabel <= 0)
+ continue;
+ else {
+ cellAmplitude *= cellEFrac;
+ cellEFrac = 1;
+ }
+ }
+ else if (fInputCellType == kFEEDataExcludeMC) {
+ if (cellMCLabel > 0)
+ continue;
+ else
+ cellAmplitude *= 1 - cellEFrac;
+ }
if (cellMCLabel > 0 && cellEFrac < 1e-6) cellEFrac = 1;
-
+
+ if (cellAmplitude < 1e-6 || cellNumber < 0)
+ continue;
+
AliEMCALDigit *digit = new((*fDigitsArr)[idigit]) AliEMCALDigit(cellMCLabel, cellMCLabel, cellNumber,
(Float_t)cellAmplitude, (Float_t)cellTime,
AliEMCALDigit::kHG,idigit, 0, 0, cellEFrac*cellAmplitude);
fClusterizer->Calibrate(energy,time,cellNumber);
digit->SetAmplitude(energy);
avgE += energy;
- }
+ }
idigit++;
}
-
- fDigitsArr->Sort();
+
+ //fDigitsArr->Sort();
if (fSubBackground) {
avgE /= fGeom->GetNumberOfSuperModules()*48*24;
AliError(Form("Cannot get tracks named %s", fTrackName.Data()));
}
}
-
+
const Int_t Ncls = fClusterArr->GetEntries();
AliDebug(1, Form("total no of clusters %d", Ncls));
for(Int_t i=0, nout=clus->GetEntries(); i < Ncls; ++i) {
void AliAnalysisTaskEMCALClusterizeFast::UpdateCells()
{
// Update cells in case re-calibration was done.
-
if (!fCalibData&&!fSubBackground)
return;
fClusterArr = const_cast<TObjArray *>(fClusterizer->GetRecPoints());
// Get the emcal cells
- if (fInputCellType == kFEEData && !fCaloCells) {
+ if ((fInputCellType == kFEEData || fInputCellType == kFEEDataMCOnly || fInputCellType == kFEEDataExcludeMC) && !fCaloCells) {
if (fCaloCellsName.IsNull()) {
fCaloCells = InputEvent()->GetEMCALCells();
}
if (!clus)
return kFALSE;
+
+ if (!clus->IsEMCAL())
+ return kFALSE;
if (clus->GetLabel() > 0) {
if (clus->TestBits(fMCClusterBitMap) != (Int_t)fMCClusterBitMap) {
return kFALSE;
}
}
-
- if (!clus->IsEMCAL())
- return kFALSE;
if (clus->GetTOF() > fClusTimeCutUp || clus->GetTOF() < fClusTimeCutLow)
return kFALSE;
task->SetAttachClusters(kTRUE);
task->SetCaloClustersName(clusName);
task->SetCaloCellsName(cellsName);
- task->SetInputCellType(AliAnalysisTaskEMCALClusterizeFast::kFEEData);
+ task->SetInputCellType(inputCellType);
task->SetUpdateCells(updateCells);
task->SetClusterBadChannelCheck(remBC);
task->SetRejectExoticClusters(remExotic);
{
// Default constructor.
SetSuffix("AODEmbedding");
- SetMarkMC(0);
fAODfilterBits[0] = -1;
fAODfilterBits[1] = -1;
fEtaMin = -1;
{
// Standard constructor.
SetSuffix("AODEmbedding");
- SetMarkMC(0);
fAODfilterBits[0] = -1;
fAODfilterBits[1] = -1;
fEtaMin = -1;
AliError(Form("Could not find cluster %d in branch %s of tree %s!", i, fAODClusName.Data(), fAODTreeName.Data()));
continue;
}
+
+ if (!clus->IsEMCAL())
+ continue;
+
TLorentzVector vect;
Double_t vert[3] = {0,0,0};
clus->GetMomentum(vect,vert);
vect.Eta() < fEtaMin || vect.Eta() > fEtaMax ||
vect.Phi() < fPhiMin || vect.Phi() > fPhiMax)
continue;
-
+
Int_t label = 0;
if (fIsAODMC) {
label = clus->GetLabel();
if (label <= 0)
AliWarning(Form("%s: Clus %d with label<=0", GetName(), i));
}
-
AddCluster(clus);
}
}
totalEnergy += amp;
}
}
-
AliDebug(2,Form("Added cells = %d (energy = %f), total cells = %d", fAddedCells, totalEnergy, totalCells));
}
}
void SetJetConstituentMinPt(Double_t pt) { fJetConstituentMinPt= pt ; }
void SetJetType(Byte_t t) { fJetType = t ; }
void SetJetAlgo(Byte_t t) { fJetAlgo = t ; }
+ void SetZVertexCut(Double_t z) { fZVertexCut = z ; }
protected:
Bool_t ExecOnce() ;// intialize task
Run();
- if (fCaloCells) {
+ if (fCaloCells && !fCopyArray) {
delete fCaloCells;
fCaloCells = tempCaloCells;
}
{
// Add a cell to the event.
- if (label == 0)
+ if (label <= 0)
label = fMarkMC;
else
label += fMCLabelShift;
- Short_t pos = fOutCaloCells->GetCellPosition(absId);
+ Short_t pos = -1;
+ if (fCaloCells)
+ pos = fCaloCells->GetCellPosition(absId);
+
Double_t efrac = 1;
Bool_t increaseOnSuccess = kFALSE;
Double_t old_efrac = 0;
fOutCaloCells->GetCell(pos, cellNumber, old_e, old_time, old_label, old_efrac);
- if (e / (old_e + e) < old_efrac) {
+ efrac = e / (old_e + e);
+
+ if (old_label > 0 && e < old_efrac * old_e) {
label = old_label;
+ efrac = old_efrac;
time = old_time;
}
- efrac = (e + old_e * old_efrac) / (e + old_e);
e += old_e;
}
UInt_t nlabels = oc->GetNLabels();
Int_t *labels = oc->GetLabels();
- if (nlabels != 0 && labels) {
+ if (nlabels != 0 && labels && labels[0] >= 0) {
AliESDCaloCluster *esdClus = dynamic_cast<AliESDCaloCluster*>(dc);
if (esdClus) {
TArrayI parents(nlabels, labels);
aodClus->SetLabel(labels, nlabels);
}
}
+ else if (fMarkMC != 0) {
+ AliESDCaloCluster *esdClus = dynamic_cast<AliESDCaloCluster*>(dc);
+ if (esdClus) {
+ TArrayI parents(1, &fMarkMC);
+ esdClus->AddLabels(parents);
+ }
+ else {
+ AliAODCaloCluster *aodClus = dynamic_cast<AliAODCaloCluster*>(dc);
+ if (aodClus)
+ aodClus->SetLabel(&fMarkMC,1);
+ }
+ }
return dc;
}
if (!fCaloCells)
return;
+ fAddedCells = 0;
+ fCaloCells->Sort();
for (Short_t i = 0; i < fCaloCells->GetNumberOfCells(); i++) {
Int_t mclabel = 0;
Double_t efrac = 0.;
mclabel = 0;
fOutCaloCells->SetCell(i, cellNum, amp, time, mclabel, efrac);
+ fAddedCells++;
}
- fAddedCells = fCaloCells->GetNumberOfCells();
-
AliDebug(2, Form("%d cells from the current event", fAddedCells));
}
fHistTrials(0),
fHistXsection(0),
fHistEvents(0),
+ fMCEnergy1vsEnergy2(0),
fHistJets1PhiEta(0),
fHistJets1PtArea(0),
fHistJets1CorrPtArea(0),
fHistTrials(0),
fHistXsection(0),
fHistEvents(0),
+ fMCEnergy1vsEnergy2(0),
fHistJets1PhiEta(0),
fHistJets1PtArea(0),
fHistJets1CorrPtArea(0),
}
}
+ if (fIsEmbedded) {
+ fMCEnergy1vsEnergy2 = new TH2F("fMCEnergy1vsEnergy2", "fMCEnergy1vsEnergy2", fNbins, fMinBinPt, fMaxBinPt*4, fNbins, fMinBinPt, fMaxBinPt*4);
+ fMCEnergy1vsEnergy2->GetXaxis()->SetTitle("#Sigmap_{T,1}^{MC}");
+ fMCEnergy1vsEnergy2->GetYaxis()->SetTitle("#Sigmap_{T,2}");
+ fMCEnergy1vsEnergy2->GetZaxis()->SetTitle("counts");
+ fOutput->Add(fMCEnergy1vsEnergy2);
+ }
+
// Jets 1 histograms
fHistLeadingJets1PtArea = new TH2F("fHistLeadingJets1PtArea", "fHistLeadingJets1PtArea", 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3, fNbins, fMinBinPt, fMaxBinPt);
fHistLeadingJets1PtArea->GetXaxis()->SetTitle("area");
}
jet2->ResetMatching();
+
+
+ if (!AcceptJet(jet2))
+ continue;
+
+ if (jet2->Eta() < fJet2MinEta || jet2->Eta() > fJet2MaxEta || jet2->Phi() < fJet2MinPhi || jet2->Phi() > fJet2MaxPhi)
+ continue;
}
for (Int_t i = 0; i < nJets1; i++) {
if (!AcceptJet(jet1))
continue;
+ if (jet1->MCPt() < 1)
+ continue;
+
if (order) {
if (jet1->Eta() < fJet2MinEta || jet1->Eta() > fJet2MaxEta || jet1->Phi() < fJet2MinPhi || jet1->Phi() > fJet2MaxPhi)
continue;
continue;
}
else {
- if (jet1->Eta() < fJet2MinEta || jet1->Eta() > fJet2MaxEta || jet1->Phi() < fJet2MinPhi || jet1->Phi() > fJet2MaxPhi)
+ if (jet2->Eta() < fJet2MinEta || jet2->Eta() > fJet2MaxEta || jet2->Phi() < fJet2MinPhi || jet2->Phi() > fJet2MaxPhi)
continue;
}
Int_t naccJets2 = 0;
Int_t naccJets2Acceptance = 0;
+ Double_t totalPt2 = 0;
+
for (Int_t i = 0; i < nJets2; i++) {
AliEmcalJet* jet2 = static_cast<AliEmcalJet*>(fJets2->At(indexes[i]));
fHistJets2PtAreaAcceptance->Fill(jet2->Area(), jet2->Pt());
fHistJets2PhiEtaAcceptance->Fill(jet2->Eta(), jet2->Phi());
+
+ totalPt2 += jet2->Pt();
if (naccJets2Acceptance < fNLeadingJets)
fHistLeadingJets2PtAreaAcceptance->Fill(jet2->Area(), jet2->Pt());
const Int_t nJets1 = fJets->GetEntriesFast();
Int_t naccJets1 = 0;
+ Double_t totalMCPt1 = 0;
for (Int_t i = 0; i < nJets1; i++) {
fHistJets1PtArea->Fill(jet1->Area(), jet1->Pt());
fHistJets1PhiEta->Fill(jet1->Eta(), jet1->Phi());
+ totalMCPt1 += jet1->MCPt();
+
if (naccJets1 < fNLeadingJets)
fHistLeadingJets1PtArea->Fill(jet1->Area(), jet1->Pt());
naccJets1++;
}
+ if (fIsEmbedded)
+ fMCEnergy1vsEnergy2->Fill(totalMCPt1, totalPt2);
+
return kTRUE;
}
TH1 *fHistTrials; //!trials from pyxsec.root
TProfile *fHistXsection; //!x section from pyxsec.root
TH1 *fHistEvents; //!total number of events per pt hard bin
+ TH2 *fMCEnergy1vsEnergy2; //!total MC energy jet 1 vs total energy jet 2
// Jets 1
TH2 *fHistJets1PhiEta; //!phi-eta distribution of jets 1
TH2 *fHistJets1PtArea; //!inclusive jet pt vs area histogram 1
jetEmb->SetTriggerMask(mask);
jetEmb->SetCopyArray(copyArray);
jetEmb->SetNClusters(1);
+ jetEmb->SetMarkMC(0);
jetEmb->SetIncludeNoITS(includeNoITS);
TString runPeriod(runperiod);
jetEmb->SetCopyArray(copyArray);
jetEmb->SetJetMinPt(minJetPt);
jetEmb->SetNClusters(1);
+ jetEmb->SetMarkMC(0);
+
if (strcmp(fileTable, "") != 0)
jetEmb->SetFileTable(GenerateFileTable(fileTable));