void AddRsnPairsRho(AliAnalysisTaskSE *task, Bool_t isMC, Bool_t isMixing, AliPID::EParticleType pType1, Int_t listID1, AliPID::EParticleType pType2, Int_t listID2, AliRsnCutSet *cutsEvent=0, AliRsnCutSet *cutsPair=0, TString suffix = "") { Printf("id1=%d id2=%d",listID1,listID2); // retrieve mass from PDG database Int_t pdg = 113; TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = db->GetParticle(pdg); Double_t mass = part->Mass(); Bool_t valid; Int_t isRsnMini = AliAnalysisManager::GetGlobalInt("rsnUseMiniPackage",valid); if (isRsnMini) { AddPairOutputMiniRho(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsPair,suffix); } else { // this function is common and it is located in RsnConfig.C // as ouptup AddPairOutputPhi from this macro will be taken AddPair(task,isMC,isMixing,pType1,listID1,pType2,listID2,pdg,mass,cutsEvent,cutsPair,suffix); } }
void CompareMasses() { TString massWidthFile = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName()); massWidthFile.ReplaceAll("CompareMasses.C","mass_width_2008.mc.txt"); FILE* file = fopen(massWidthFile.Data(),"r"); if (!file){ Printf("Could not open PDG particle file %s", massWidthFile.Data()); return; } char c[200]; char cempty; Int_t pdg[4]; Float_t mass, err1, err2, err; Int_t ndiff = 0; while (fgets(c, 200, file)) { if (c[0] != '*' && c[0] !='W') { //printf("%s",c); sscanf(&c[1], "%8d", &pdg[0]); // check emptyness pdg[1] = 0; for(int i = 0;i<8;i++){ sscanf(&c[9+i],"%c",&cempty); if(cempty != ' ')sscanf(&c[9],"%8d",&pdg[1]); } pdg[2] = 0; for(int i = 0;i<8;i++){ sscanf(&c[17+i],"%c",&cempty); if(cempty != ' ')sscanf(&c[17],"%8d",&pdg[2]); } pdg[3] = 0; for(int i = 0;i<8;i++){ sscanf(&c[25+i],"%c",&cempty); if(cempty != ' ')sscanf(&c[25],"%8d",&pdg[3]); } sscanf(&c[35],"%14f",&mass); sscanf(&c[50],"%8f",&err1); sscanf(&c[50],"%8f",&err2); err = TMath::Max((Double_t)err1,(Double_t)-1.*err2); for(int ipdg = 0;ipdg < 4;ipdg++){ if(pdg[ipdg]==0)continue; TParticlePDG *partRoot = TDatabasePDG::Instance()->GetParticle(pdg[ipdg]); if(partRoot){ Float_t massRoot = partRoot->Mass(); Float_t deltaM = TMath::Abs(massRoot - mass); // if(deltaM > err){ if (mass != 0.0 && deltaM/mass>1E-05){ ndiff++; Printf("%10s %8d pdg mass %E pdg err %E root Mass %E >> deltaM %E = %3.3f%%",partRoot->GetName(),pdg[ipdg],mass,err,massRoot,deltaM,100.*deltaM/mass); } } } } }// while fclose(file); if (ndiff == 0) Printf("Crongratulations !! All particles in ROOT and PDG have identical masses"); }
void AddPairOutputMiniRho(AliAnalysisTaskSE *task, Bool_t isMC,Bool_t isMixing, AliPID::EParticleType pType1,Int_t listID1, AliPID::EParticleType pType2,Int_t listID2, Int_t pdgMother,Double_t massMother, AliRsnCutSet *cutsPair=0,TString suffix = "") { Bool_t valid; Int_t isFullOutput = AliAnalysisManager::GetGlobalInt("rsnOutputFull",valid); Int_t useMixing = AliAnalysisManager::GetGlobalInt("rsnUseMixing",valid); Int_t isPP = AliAnalysisManager::GetGlobalInt("rsnIsPP",valid); AliRsnMiniAnalysisTask *taskRsnMini = (AliRsnMiniAnalysisTask *)task; /* invariant mass */ Int_t imID = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMass, kFALSE); /* IM resolution */ Int_t resID = taskRsnMini->CreateValue(AliRsnMiniValue::kInvMassDiff, kTRUE); /* transv. momentum */ Int_t ptID = taskRsnMini->CreateValue(AliRsnMiniValue::kPt, kFALSE); /* centrality */ Int_t centID = taskRsnMini->CreateValue(AliRsnMiniValue::kMult, kFALSE); /* eta */ Int_t etaID = taskRsnMini->CreateValue(AliRsnMiniValue::kEta, kFALSE); // use an array for more compact writing, which are different on mixing and charges // [0] = unlike // [1] = mixing // [2] = like ++ // [3] = like -- Bool_t use [5] = { 1 , useMixing , 1 , 1 , isMC }; TString name [5] = {"Unlike", "Mixing", "LikePP", "LikeMM", "Trues"}; TString comp [5] = {"PAIR" , "MIX" , "PAIR" , "PAIR" , "TRUE" }; Char_t charge1 [5] = {'+' , '+' , '+' , '-' , '+' }; Char_t charge2 [5] = {'-' , '-' , '+' , '-' , '-' }; // common definitions TString outputType = "HIST"; if (isFullOutput) outputType = "SPARSE"; Int_t nIM = 1000; Double_t minIM = 0.2, maxIM = 1.2; Int_t nEta = 400; Double_t minEta = -2.0, maxEta = 2.0; // Int_t nIM = 1000; Double_t minIM = 0.9, maxIM = 1.9; Int_t nPt = 120; Double_t minPt = 0.0, maxPt = 12.0; Int_t nCent = 100; Double_t minCent = 0.0, maxCent = 100.0; Int_t nRes = 200; Double_t maxRes = 0.01; // retrieve mass from PDG database Int_t pdg = 113; TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = db->GetParticle(pdg); Printf(suffix.Data()); // create standard outputs for (Int_t i = 0; i < 5; i++) { if (!use[i]) continue; // create output AliRsnMiniOutput *out = taskRsnMini->CreateOutput(Form("%s_%s", suffix.Data(),name[i].Data() ), outputType.Data(), comp[i].Data()); // selection settings out->SetCutID(0, listID1); out->SetCutID(1, listID1); out->SetDaughter(0, AliRsnDaughter::kPion); out->SetDaughter(1, AliRsnDaughter::kPion); out->SetCharge(0, charge1[i]); out->SetCharge(1, charge2[i]); out->SetMotherPDG(pdg); out->SetMotherMass(part->Mass()); // pair cuts if (cutsPair) out->SetPairCuts(cutsPair); // axis X: invmass out->AddAxis(imID, nIM, minIM, maxIM); if (isFullOutput) { // axis Y: transverse momentum out->AddAxis(ptID, nPt, minPt, maxPt); out->AddAxis(etaID, nEta, minEta, maxEta); // axis Z: centrality if (!isPP) out->AddAxis(centID, nCent, minCent, maxCent); } } // add output for resolution if (isMC) { AliRsnMiniOutput *outRes = taskRsnMini->CreateOutput(Form("rho_Res%s", suffix.Data()), outputType.Data(), "TRUE"); // selection settings outRes->SetCutID(0, listID1); outRes->SetCutID(1, listID1); outRes->SetDaughter(0, AliRsnDaughter::kPion); outRes->SetDaughter(1, AliRsnDaughter::kPion); outRes->SetCharge(0, '+'); outRes->SetCharge(1, '-'); outRes->SetMotherPDG(pdg); outRes->SetMotherMass(part->Mass()); // pair cuts if (cutsPair) outRes->SetPairCuts(cutsPair); // axis X: resolution outRes->AddAxis(resID, nRes, -maxRes, maxRes); if (isFullOutput) { // axis Y: transverse momentum outRes->AddAxis(ptID, nPt, minPt, maxPt); outRes->AddAxis(etaID, nEta, minEta, maxEta); // axis Z: centrality if (!isPP) outRes->AddAxis(centID, nCent, minCent, maxCent); } } // // -- Create output for MC generated ------------------------------------------------------------ // if (isMC) { // create ouput AliRsnMiniOutput *outMC = taskRsnMini->CreateOutput(Form("rho_MCGen%s", suffix.Data()), outputType.Data(), "MOTHER"); // selection settings outMC->SetDaughter(0, AliRsnDaughter::kPion); outMC->SetDaughter(1, AliRsnDaughter::kPion); outMC->SetMotherPDG(pdg); outMC->SetMotherMass(part->Mass()); // pair cuts if (cutsPair) outMC->SetPairCuts(cutsPair); // axis X: invmass outMC->AddAxis(imID, nIM, minIM, maxIM); if (isFullOutput) { // axis Y: transverse momentum outMC->AddAxis(ptID, nPt, minPt, maxPt); outMC->AddAxis(etaID, nEta, minEta, maxEta); // axis Z: centrality if (!isPP) outMC->AddAxis(centID, nCent, minCent, maxCent); } } }
Bool_t ConfigPhiPP5TeV( AliRsnMiniAnalysisTask *task, Bool_t isMC, Bool_t isPP, const char *suffix, AliRsnCutSet *cutsPair, Int_t Strcut = 2011, Int_t customQualityCutsID = AliRsnCutSetDaughterParticle::kDisableCustom, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate=AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s, Float_t nsigmaK = 3.0, Bool_t enableMonitor = kTRUE ) { //These are the Default values for 2011 ESD track cuts AliPID::EParticleType type2 = AliPID::kKaon; // manage suffix if (strlen(suffix) > 0) suffix = Form("_%s", suffix); // retrieve mass from PDG database Int_t pdg = 333; TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = db->GetParticle(pdg); Double_t mass = part->Mass(); Float_t nsigmaKTPC=fmod(nsigmaK,1000.); Float_t nsigmaKTOF=(nsigmaK-fmod(nsigmaK,1000.))/1000.; if(nsigmaKTOF<1.e-10) nsigmaKTOF=-1.; // set daughter cuts AliRsnCutSetDaughterParticle* cutSetK; AliRsnCutTrackQuality* trkQualityCut= new AliRsnCutTrackQuality("myQualityCut"); if(!trkQualityCut) return kFALSE; if(SetCustomQualityCut(trkQualityCut,customQualityCutsID,Strcut)){ cutSetK=new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",cutKaCandidate, nsigmaK),trkQualityCut,cutKaCandidate,AliPID::kKaon,nsigmaKTPC,nsigmaKTOF); } else{ printf("Doughter Track cuts has been selected =================\n"); return kFALSE; } Int_t iCutK = task->AddTrackCuts(cutSetK); if(enableMonitor){ Printf("======== Monitoring cut AliRsnCutSetDaughterParticle enabled"); gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/AddMonitorOutput.C"); AddMonitorOutput(isMC, cutSetK->GetMonitorOutput()); } // -- Values ------------------------------------------------------------------------------------ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE); /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE); /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE); /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); /* pseudorapidity */ Int_t etaID = task->CreateValue(AliRsnMiniValue::kEta, kFALSE); /* rapidity */ Int_t yID = task->CreateValue(AliRsnMiniValue::kY, kFALSE); // -- Create all needed outputs ----------------------------------------------------------------- // use an array for more compact writing, which are different on mixing and charges // [0] = unlike // [1] = mixing // [2] = like ++ // [3] = like -- Bool_t use [7] = {1 ,1 ,1 ,1 ,isMC ,isMC ,isMC }; Bool_t useIM [7] = {1 ,1 ,1 ,1 ,1 ,1 ,0 }; TString name [7] = {"Unlike" ,"Mixing" ,"LikePP" ,"LikeMM" ,"MCGen" ,"Trues", ,"ResMP" }; TString comp [7] = {"PAIR" ,"MIX" ,"PAIR" ,"PAIR" ,"MOTHER" ,"TRUE" ,"TRUE" }; TString output [7] = {"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE"}; Char_t charge1 [7] = {'+' ,'+' ,'+' ,'-' ,'+' ,'+' ,'+' }; Char_t charge2 [7] = {'-' ,'-' ,'+' ,'-' ,'-' ,'-' ,'-' }; Int_t cutIDK [7] = {iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK }; Int_t PDGCode [7] = {333 ,333 ,333 ,333 ,333 ,333 ,333 }; for (Int_t i = 0; i < 7; i++) { if (!use[i]) continue; AliRsnMiniOutput *out = task->CreateOutput(Form("PHI_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data()); out->SetDaughter(0, AliRsnDaughter::kKaon); out->SetDaughter(1, AliRsnDaughter::kKaon); out->SetCutID(0, cutIDK[i]); out->SetCutID(1, cutIDK[i]); out->SetCharge(0, charge1[i]); out->SetCharge(1, charge2[i]); out->SetMotherPDG(PDGCode[i]); out->SetMotherMass(mass); out->SetPairCuts(cutsPair); // axis X: invmass (or resolution) if (useIM[i]) out->AddAxis(imID, 250, 0.95, 1.2); else out->AddAxis(resID, 200, -0.02, 0.02); // axis Y: transverse momentum out->AddAxis(ptID, 500, 0.0, 50.0); // axis Z: centrality-multiplicity if (!isPP) out->AddAxis(centID, 100, 0.0, 100.0); else out->AddAxis(centID, 400, 0.0, 400.0); // axis W: pseudorapidity // out->AddAxis(etaID, 20, -1.0, 1.0); // axis J: rapidity //out->AddAxis(yID, 90, -4.5, 4.5); } return kTRUE; } Bool_t SetCustomQualityCut(AliRsnCutTrackQuality * trkQualityCut, Int_t customQualityCutsID = 0,Int_t trCut = 2011) { //Sets configuration for track quality object different from std quality cuts. //Returns kTRUE if track quality cut object is successfully defined, //returns kFALSE if an invalid set of cuts (customQualityCutsID) is chosen or if the //object to be configured does not exist. if ((!trkQualityCut)){ Printf("::::: SetCustomQualityCut:: use default quality cuts specified in task configuration."); return kFALSE; } if(customQualityCutsID>=1 && customQualityCutsID<100 && customQualityCutsID!=2){ if(trCut == 2011){ trkQualityCut->SetDefaults2011(kTRUE,kTRUE); Printf(Form("::::: SetCustomQualityCut:: using standard 2011 track quality cuts")); } else if(trCut == 2015){ trkQualityCut->SetDefaults2011(kTRUE,kTRUE); trkQualityCut->GetESDtrackCuts()->SetCutGeoNcrNcl(3., 130., 1.5, 0.85, 0.7); Printf(Form("::::: SetCustomQualityCut:: using standard 2015 track quality cuts")); } if(customQualityCutsID==3){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexXYPtDep("0.015+0.05/pt^1.1");}//10Sig // D = 7*(0.0015+0.0050/pt^1.1) else if(customQualityCutsID==4){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexXYPtDep("0.006+0.02/pt^1.1");}//4Sig else if(customQualityCutsID==5){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexZ(3.);}// D = 2. else if(customQualityCutsID==6){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexZ(1.);} else if(customQualityCutsID==7){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexZ(0.2);} else if(customQualityCutsID==8){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterTPC(5.);}// D = 4 else if(customQualityCutsID==9){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterTPC(3);} else if(customQualityCutsID==10){trkQualityCut->GetESDtrackCuts()->SetMinNCrossedRowsTPC(60);}// D = 70 else if(customQualityCutsID==11){trkQualityCut->GetESDtrackCuts()->SetMinNCrossedRowsTPC(80);} else if(customQualityCutsID==12){trkQualityCut->GetESDtrackCuts()->SetMinNCrossedRowsTPC(100);} else if(customQualityCutsID==13){trkQualityCut->GetESDtrackCuts()->SetMinRatioCrossedRowsOverFindableClustersTPC(0.7);}// D = 8 else if(customQualityCutsID==14){trkQualityCut->GetESDtrackCuts()->SetMinRatioCrossedRowsOverFindableClustersTPC(0.9);} else if(customQualityCutsID==15){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterITS(49.);}// D = 36 else if(customQualityCutsID==16){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterITS(25.);} else if(customQualityCutsID==17){trkQualityCut->GetESDtrackCuts()->SetMaxChi2TPCConstrainedGlobal(49.);}// D = 36 else if(customQualityCutsID==18){trkQualityCut->GetESDtrackCuts()->SetMaxChi2TPCConstrainedGlobal(25.);} else if(customQualityCutsID==19){trkQualityCut->GetESDtrackCuts()->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kOff);} trkQualityCut->Print(); return kTRUE; }else if(customQualityCutsID==2 || (customQualityCutsID>=100 && customQualityCutsID<200)){ trkQualityCut->SetDefaultsTPCOnly(kTRUE); Printf(Form("::::: SetCustomQualityCut:: using TPC-only track quality cuts")); if(customQualityCutsID==103){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexXY(3.);} else if(customQualityCutsID==104){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexXY(1.);} else if(customQualityCutsID==105){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexZ(4.);} else if(customQualityCutsID==106){trkQualityCut->GetESDtrackCuts()->SetMaxDCAToVertexZ(1.);} else if(customQualityCutsID==107){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterTPC(7.);} else if(customQualityCutsID==108){trkQualityCut->GetESDtrackCuts()->SetMaxChi2PerClusterTPC(2.5);} else if(customQualityCutsID==109){trkQualityCut->GetESDtrackCuts()->SetMinNClustersTPC(30);} else if(customQualityCutsID==110){trkQualityCut->GetESDtrackCuts()->SetMinNClustersTPC(85);} trkQualityCut->Print(); return kTRUE; }else{ Printf("::::: SetCustomQualityCut:: use default quality cuts specified in task configuration."); return kFALSE; } trkQualityCut->SetPtRange(0.15, 100000.0); trkQualityCut->SetEtaRange(-0.8, 0.8); Printf(Form("::::: SetCustomQualityCut:: using custom track quality cuts #%i",customQualityCutsID)); trkQualityCut->Print(); return kTRUE; }
/** @ingroup FMD_xsec_script @param scale @param filename @param var @param medName @param thick @param pdgName */ void DrawXsection(Bool_t scale=kFALSE, const char* filename="xsec.root", const char* var="LOSS", const char* medName="FMD_Si$", Double_t thick=.03, const char* pdgName="pi+") { TFile* file = TFile::Open(filename, "READ"); TTree* tree = static_cast<TTree*>(file->Get(Form("%s_%s",medName, pdgName))); TLeaf* tb = tree->GetLeaf("T"); TLeaf* vb = tree->GetLeaf(var); if (!vb) { std::cerr << "Leaf " << var << " not found" << std::endl; return; } Float_t tkine, value; tb->SetAddress(&tkine); vb->SetAddress(&value); Int_t n = tree->GetEntries(); Float_t xscale = 1; Float_t yscale = 1; if (scale) { TDatabasePDG* pdgDb = TDatabasePDG::Instance(); TParticlePDG* pdgP = pdgDb->GetParticle(pdgName); if (!pdgP) { std::cerr << "Couldn't find particle " << pdgName << std::endl; return; } Double_t m = pdgP->Mass(); Double_t q = pdgP->Charge() / 3; if (m == 0 || q == 0) { std::cerr << "Mass is 0" << std::endl; return; } xscale = 1 / m; yscale = 1 / (q * q); } TGraphErrors* graph = new TGraphErrors(n); for (Int_t i = 0; i < n; i++) { tree->GetEntry(i); Double_t x = tkine*xscale; Double_t y = value*yscale; graph->SetPoint(i, x, y); // 5 sigma graph->SetPointError(i, 0, 5 * .1 * y); } TCanvas* c = new TCanvas("c","c"); c->SetLogx(); c->SetLogy(); graph->SetLineWidth(2); graph->SetFillStyle(3001); graph->SetFillColor(6); graph->Draw("L"); graph->DrawClone("AL3"); c->Modified(); c->Update(); c->cd(); c->SaveAs("xsec.C"); }
Bool_t ConfigPhiMassStudy ( AliRsnMiniAnalysisTask *task, Bool_t isMC, Bool_t isPP, const char *suffix, AliRsnCutSet *cutsPair, Int_t aodFilterBit = 5, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kFastTPCpidNsigma, Float_t nsigmaKa = 2.0, Bool_t enableTrkSyst = kFALSE, Char_t DCAxyFormula[100] = "0.0105+0.035/pt^1.01", Double_t dcazmax = 3.2, Double_t minNcls = 70, Double_t maxX2cls = 4.0, Double_t globalX2cls = 36.0, Double_t minCrossedRows = 50.0, Double_t maxClsCrossedRows = 0.8, Bool_t enableMonitor = kTRUE, Bool_t IsMcTrueOnly = kFALSE, Int_t signedPdg = 333, TString monitorOpt = "", //Flag for AddMonitorOutput.C e.g."NoSIGN" Bool_t useCrossedRows = kFALSE, const char* yaxisVar = "PtDaughter_PDaughter_cent", //yaxisVar = "PtDaughter_PDaughter_cent" Bool_t useMixLS = 0 ) { TString opt(yaxisVar); opt.ToUpper(); Bool_t isPtDaughter = opt.Contains("PTDAUGHTER") ; Bool_t isPDaughter = opt.Contains("PDAUGHTER") ; Bool_t iscent = opt.Contains("CENT") ; Bool_t iseta = opt.Contains("ETA") ; Bool_t israpidity = opt.Contains("RAPIDITY") ; // manage suffix if (strlen(suffix) > 0) suffix = Form("_%s", suffix); // set daughter cuts AliRsnCutSetDaughterParticle * cutSetQ; AliRsnCutSetDaughterParticle * cutSetK; //vary track quality cuts for systematic checks if(enableTrkSyst){ AliRsnCutTrackQuality * trkQualityCut = new AliRsnCutTrackQuality("QualityCut"); trkQualityCut->SetAODTestFilterBit(aodFilterBit);//reset the filter bit cut trkQualityCut->SetCheckOnlyFilterBit(kFALSE);//tells the cut object to check all other cuts individually, trkQualityCut->SetDCARPtFormula(DCAxyFormula); trkQualityCut->SetDCAZmax(dcazmax); if(useCrossedRows) { trkQualityCut->SetMinNCrossedRowsTPC(minCrossedRows, kTRUE); trkQualityCut->SetMinNCrossedRowsOverFindableClsTPC(maxClsCrossedRows, kTRUE); } else trkQualityCut->SetTPCminNClusters(minNcls); trkQualityCut->SetTPCmaxChi2(maxX2cls); trkQualityCut->SetITSmaxChi2(36); // In Filter bit trkQualityCut->SetMaxChi2TPCConstrainedGlobal(globalX2cls); // In the Filterbit trkQualityCut->SetPtRange(0.15, 20.0); trkQualityCut->SetEtaRange(-0.8, 0.8); trkQualityCut->Print(); if(isPP) { cutSetQ = new AliRsnCutSetDaughterParticle(Form("cutQ_bit%i",aodFilterBit), trkQualityCut, AliRsnCutSetDaughterParticle::kQualityStd2010, AliPID::kPion, -1.0); cutSetK = new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",cutKaCandidate, nsigmaKa), trkQualityCut, cutKaCandidate, AliPID::kKaon, nsigmaKa); } else { cutSetQ = new AliRsnCutSetDaughterParticle(Form("cutQ_bit%i",aodFilterBit), trkQualityCut, AliRsnCutSetDaughterParticle::kQualityStd2011, AliPID::kPion, -1.0); cutSetK = new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",cutKaCandidate, nsigmaKa), trkQualityCut, cutKaCandidate, AliPID::kKaon, nsigmaKa); cutSetK->SetUse2011StdQualityCuts(kTRUE); } } else { //default cuts 2010 for pp and 2011 for p-Pb if(isPP) { cutSetQ = new AliRsnCutSetDaughterParticle("cutQuality", AliRsnCutSetDaughterParticle::kQualityStd2010, AliPID::kPion, -1.0, aodFilterBit, kFALSE); cutSetK = new AliRsnCutSetDaughterParticle(Form("cutKaon_%2.1f2sigma",nsigmaKa), cutKaCandidate, AliPID::kKaon, nsigmaKa, aodFilterBit, kFALSE); } else { cutSetQ = new AliRsnCutSetDaughterParticle("cutQuality", AliRsnCutSetDaughterParticle::kQualityStd2011, AliPID::kPion, -1.0, aodFilterBit, kFALSE); cutSetQ->SetUse2011StdQualityCuts(kTRUE); cutSetK = new AliRsnCutSetDaughterParticle(Form("cutKaon2011_%2.1f2sigma",nsigmaKa), cutKaCandidate, AliPID::kKaon, nsigmaKa, aodFilterBit, kFALSE); cutSetK->SetUse2011StdQualityCuts(kTRUE); } } Int_t iCutQ = task->AddTrackCuts(cutSetQ); Int_t iCutK = task->AddTrackCuts(cutSetK); if (enableMonitor){ Printf("======== Cut monitoring enabled"); gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/AddMonitorOutput.C"); AddMonitorOutput(isMC, cutSetQ->GetMonitorOutput(), monitorOpt.Data()); AddMonitorOutput(isMC, cutSetK->GetMonitorOutput(), monitorOpt.Data()); } Int_t pdg = signedPdg; TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = db->GetParticle(pdg); Double_t mass = part->Mass(); // -- Values ------------------------------------------------------------------------------------ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE); /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE); /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE); /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); /* pseudorapidity */ Int_t etaID = task->CreateValue(AliRsnMiniValue::kEta, kFALSE); /* rapidity */ Int_t yID = task->CreateValue(AliRsnMiniValue::kY, kFALSE); /* 1st daughter pt */ Int_t fdpt = task->CreateValue(AliRsnMiniValue::kFirstDaughterPt, kFALSE); /* 2nd daughter pt */ Int_t sdpt = task->CreateValue(AliRsnMiniValue::kSecondDaughterPt, kFALSE); /* 1st daughter p */ Int_t fdp = task->CreateValue(AliRsnMiniValue::kFirstDaughterP, kFALSE); /* 2nd daughter p */ Int_t sdp = task->CreateValue(AliRsnMiniValue::kSecondDaughterP, kFALSE); /* transv. momentum */ Int_t ptIDmc = task->CreateValue(AliRsnMiniValue::kPt, kTRUE); /* 1st daughter pt */ Int_t fdptmc = task->CreateValue(AliRsnMiniValue::kFirstDaughterPt, kTRUE); /* 2nd daughter pt */ Int_t sdptmc = task->CreateValue(AliRsnMiniValue::kSecondDaughterPt, kTRUE); // -- Create all needed outputs ----------------------------------------------------------------- // use an array for more compact writing, which are different on mixing and charges // [0] = unlike // [1] = mixing // [2] = like ++ // [3] = like -- Bool_t use [12] = { !IsMcTrueOnly, !IsMcTrueOnly, !IsMcTrueOnly,!IsMcTrueOnly,!IsMcTrueOnly,!IsMcTrueOnly, isMC , isMC , isMC , isMC , useMixLS , useMixLS}; Bool_t useIM [12] = { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 }; TString name [12] = {"UnlikePM" , "UnlikeMP" , "MixingPM" , "MixingMP" , "LikePP" , "LikeMM" ,"TruesPM","TruesMP","ResPM" ,"ResMP" ,"MixingPP","MixingMM"}; TString comp [12] = {"PAIR" , "PAIR" , "MIX" , "MIX" , "PAIR" , "PAIR" , "TRUE" , "TRUE" , "TRUE" , "TRUE" , "MIX" ,"MIX" }; TString output [12] = {"SPARSE" , "SPARSE" , "SPARSE" , "SPARSE" , "SPARSE" , "SPARSE" , "SPARSE","SPARSE" ,"SPARSE","SPARSE","SPARSE" ,"SPARSE"}; Char_t charge1 [12] = {'+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' , '+' , '-' }; Char_t charge2 [12] = {'-' , '+' , '-' , '+' , '+' , '-' , '-' , '+' , '-' , '+' ,'+' , '-' }; Int_t cutID1 [12] = { iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK }; Int_t cutID2 [12] = { iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK , iCutK }; //TString output [10] = {"HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" , "HIST" }; for (Int_t i = 0; i < 12; i++) { if (!use[i]) continue; AliRsnMiniOutput *out = task->CreateOutput(Form("Phi_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data()); out->SetCutID(0, cutID1[i]); out->SetCutID(1, cutID2[i]); out->SetDaughter(0, AliRsnDaughter::kKaon); out->SetDaughter(1, AliRsnDaughter::kKaon); out->SetCharge(0, charge1[i]); out->SetCharge(1, charge2[i]); out->SetMotherPDG(pdg); out->SetMotherMass(mass); out->SetPairCuts(cutsPair); // axis X: invmass (or resolution) if (useIM[i]) out->AddAxis(imID, 800, 0.8, 1.6); else out->AddAxis(resID, 200, -0.02, 0.02); // axis Y: transverse momentum of pair as default - else chosen value out->AddAxis(ptID, 100, 0.0, 10.0); //default use mother pt if(isPtDaughter) { out->AddAxis(fdpt, 100, 0.0, 10.0); out->AddAxis(sdpt, 100, 0.0, 10.0); } if(isPDaughter) { out->AddAxis(fdp, 100, 0.0, 10.0); out->AddAxis(sdp, 100, 0.0, 10.0); } // axis Z: centrality-multiplicity if(iscent) { if (!isPP) out->AddAxis(centID, 100, 0.0, 100.0); else out->AddAxis(centID, 400, 0.0, 400.0); } // axis W: pseudorapidity if(iseta) out->AddAxis(etaID, 20, -1.0, 1.0); // axis J: rapidity if(israpidity) out->AddAxis(yID, 12, -0.6, 0.6); } if (isMC){ // create output AliRsnMiniOutput *outm = task->CreateOutput(Form("Phi_Mother%s", suffix), "SPARSE", "MOTHER"); outm->SetDaughter(0, AliRsnDaughter::kKaon); outm->SetDaughter(1, AliRsnDaughter::kKaon); outm->SetMotherPDG(pdg); outm->SetMotherMass(mass); // pair cuts outm->SetPairCuts(cutsPair); // binnings outm->AddAxis(imID, 800, 0.8, 1.6); // axis Y: transverse momentum of pair as default - else chosen value outm->AddAxis(ptID, 100, 0.0, 10.0); //default use mother pt if(isPtDaughter) { outm->AddAxis(fdpt, 100, 0.0, 10.0); outm->AddAxis(sdpt, 100, 0.0, 10.0); } if(isPDaughter) { outm->AddAxis(fdp, 100, 0.0, 10.0); outm->AddAxis(sdp, 100, 0.0, 10.0); } if(iscent) { if (!isPP) outm->AddAxis(centID, 100, 0.0, 100.0); else outm->AddAxis(centID, 400, 0.0, 400.0); } // axis W: pseudorapidity if(iseta) outm->AddAxis(etaID, 20, -1.0, 1.0); // axis J: rapidity if(israpidity) outm->AddAxis(yID, 12, -0.6, 0.6); //create plot for generated Pt of mother vs generated Pt of daughters AliRsnMiniOutput *outPtGen = task->CreateOutput(Form("Phi_Mother_GenPt_%s", suffix), "SPARSE", "MOTHER"); outPtGen->SetDaughter(0, AliRsnDaughter::kKaon); outPtGen->SetDaughter(1, AliRsnDaughter::kKaon); outPtGen->SetMotherPDG(pdg); outPtGen->SetMotherMass(mass); // pair cuts outPtGen->SetPairCuts(cutsPair); // binnings outPtGen->AddAxis(ptIDmc, 100, 0.0, 10.0); //mother pt - generated outPtGen->AddAxis(fdptmc, 100, 0.0, 10.0); //first daughter pt - generated outPtGen->AddAxis(sdptmc, 100, 0.0, 10.0); //second daughter pt - generated //create plot for reconstructed Pt of true mother vs generated Pt of daughters AliRsnMiniOutput *outPtTrueGen = task->CreateOutput(Form("Phi_True_GenPt_%s", suffix), "SPARSE", "TRUE"); outPtTrueGen->SetDaughter(0, AliRsnDaughter::kKaon); outPtTrueGen->SetDaughter(1, AliRsnDaughter::kKaon); outPtTrueGen->SetCutID(0, iCutK); outPtTrueGen->SetCutID(1, iCutK); outPtTrueGen->SetCharge(0, '+'); outPtTrueGen->SetCharge(1, '-'); outPtTrueGen->SetMotherPDG(pdg); outPtTrueGen->SetMotherMass(mass); // pair cuts outPtTrueGen->SetPairCuts(cutsPair); // binnings outPtTrueGen->AddAxis(ptID, 100, 0.0, 10.0); //true pt - generated outPtTrueGen->AddAxis(fdptmc, 100, 0.0, 10.0); //first daughter pt - generated outPtTrueGen->AddAxis(sdptmc, 100, 0.0, 10.0); //second daughter pt - generated //create plot for reconstructed Pt of true mother vs reconstructed Pt of daughters AliRsnMiniOutput *outPtTrueRec = task->CreateOutput(Form("Phi_True_RecPt_%s", suffix), "SPARSE", "TRUE"); outPtTrueRec->SetDaughter(0, AliRsnDaughter::kKaon); outPtTrueRec->SetDaughter(1, AliRsnDaughter::kKaon); outPtTrueRec->SetCutID(0, iCutK); outPtTrueRec->SetCutID(1, iCutK); outPtTrueRec->SetCharge(0, '+'); outPtTrueRec->SetCharge(1, '-'); outPtTrueRec->SetMotherPDG(pdg); outPtTrueRec->SetMotherMass(mass); // pair cuts outPtTrueRec->SetPairCuts(cutsPair); // binnings outPtTrueRec->AddAxis(ptID, 100, 0.0, 10.0); //mother pt - reconstructed outPtTrueRec->AddAxis(fdpt, 100, 0.0, 10.0); //first daughter pt - reconstructed outPtTrueRec->AddAxis(sdpt, 100, 0.0, 10.0); //second daughter pt - reconstructed } return kTRUE; }
Bool_t ConfigKstarPP13TeV( AliRsnMiniAnalysisTask *task, Bool_t isMC, Bool_t isPP, const char *suffix, AliRsnCutSet *cutsPair, Float_t nsigmaPi = 3.0, Float_t nsigmaK = 3.0, Bool_t enableMonitor = kTRUE, TString optSys = "DefaultITSTPC2011" ) { //These are the Default values for 2011 ESD track cuts AliPID::EParticleType type1 = AliPID::kPion; AliPID::EParticleType type2 = AliPID::kKaon; // manage suffix if (strlen(suffix) > 0) suffix = Form("_%s", suffix); // retrieve mass from PDG database Int_t pdg = 313; TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = db->GetParticle(pdg); Double_t mass = part->Mass(); // set daughter cuts AliRsnCutSetDaughterParticle* cutSetPi; AliRsnCutSetDaughterParticle* cutSetK; /* AliRsnCutTrackQuality* trkQualityCut= new AliRsnCutTrackQuality("myQualityCut"); if(optSyt.Contains("DefaultITSTPC2011")){ trkQualityCut->SetDefaults2011(kTRUE,kTRUE); Printf(Form("::::: SetCustomQualityCut:: using standard 2011 track quality cuts")); } else if(optSyt.Contains("DefaultTPCOnly")){ trkQualityCut->SetDefaultsTPCOnly(kTRUE); Printf(Form("::::: SetCustomQualityCut:: using TPC-only track quality cuts")); } trkQualityCut->Print();*/ AliRsnCutTrackQuality *fQualityTrackCut = new AliRsnCutTrackQuality("AliRsnCutTrackQuality"); //Analysis Track cuts are implemented here AliESDtrackCuts * esdTrackCuts = MyTrackCuts(1, kTRUE,optSys.Data()); fQualityTrackCut->SetESDtrackCuts(esdTrackCuts); fQualityTrackCut->SetPtRange(0.15,30); fQualityTrackCut->SetEtaRange(-0.8,0.8); //kTPCpidTOFveto4s //kTPCpidTOFveto3s //kFastTPCpidNsigma cutSetPi=new AliRsnCutSetDaughterParticle(Form("cutPi%i_%2.1fsigma",AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s,nsigmaPi),fQualityTrackCut,AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s,AliPID::kPion,nsigmaPi); cutSetK=new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s, nsigmaK),fQualityTrackCut,AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s,AliPID::kKaon,nsigmaK); Int_t iCutPi = task->AddTrackCuts(cutSetPi); Int_t iCutK = task->AddTrackCuts(cutSetK); if(enableMonitor){ Printf("======== Monitoring cut AliRsnCutSetDaughterParticle enabled"); gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/AddMonitorOutput.C"); AddMonitorOutput(isMC, cutSetPi->GetMonitorOutput()); AddMonitorOutput(isMC, cutSetK->GetMonitorOutput()); } // -- Values ------------------------------------------------------------------------------------ /* invariant mass */ Int_t imID = task->CreateValue(AliRsnMiniValue::kInvMass, kFALSE); /* IM resolution */ Int_t resID = task->CreateValue(AliRsnMiniValue::kInvMassRes, kTRUE); /* transv. momentum */ Int_t ptID = task->CreateValue(AliRsnMiniValue::kPt, kFALSE); /* centrality */ Int_t centID = task->CreateValue(AliRsnMiniValue::kMult, kFALSE); /* pseudorapidity */ Int_t etaID = task->CreateValue(AliRsnMiniValue::kEta, kFALSE); /* rapidity */ Int_t yID = task->CreateValue(AliRsnMiniValue::kY, kFALSE); // -- Create all needed outputs ----------------------------------------------------------------- // use an array for more compact writing, which are different on mixing and charges // [0] = unlike // [1] = mixing // [2] = like ++ // [3] = like -- Bool_t use [12] = {1 ,1 ,1 ,1 ,1 ,1 ,isMC ,isMC ,isMC ,isMC ,isMC ,isMC }; Bool_t useIM [12] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 }; TString name [12] = {"UnlikePM","UnlikeMP","MixingPM","MixingMP","LikePP","LikeMM","MCGenPM","MCGenMP","TruesPM","TruesMP","ResPM" ,"ResMP" }; TString comp [12] = {"PAIR" ,"PAIR" ,"MIX" ,"MIX" ,"PAIR" ,"PAIR" ,"MOTHER" ,"MOTHER" ,"TRUE" ,"TRUE" ,"TRUE" ,"TRUE" }; TString output [12] = {"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE","SPARSE","SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE" ,"SPARSE","SPARSE"}; Char_t charge1 [12] = {'+' ,'-' ,'+' ,'-' ,'+' ,'-' ,'+' ,'-' ,'+' ,'-' ,'+' ,'-' }; Char_t charge2 [12] = {'-' ,'+' ,'-' ,'+' ,'+' ,'-' ,'-' ,'+' ,'_' ,'+' ,'-' ,'+' }; Int_t cutIDPi [12] = {iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi ,iCutPi }; Int_t cutIDK [12] = {iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK }; Int_t PDGCode [12] = {313 ,313 ,313 ,313 ,313 ,313 ,313 ,-313 ,313 ,313 ,313 ,-313 }; for (Int_t i = 0; i < 12; i++) { if (!use[i]) continue; AliRsnMiniOutput *out = task->CreateOutput(Form("KSTAR_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data()); out->SetDaughter(0, AliRsnDaughter::kKaon); out->SetDaughter(1, AliRsnDaughter::kPion); out->SetCutID(0, cutIDK[i]); out->SetCutID(1, cutIDPi[i]); out->SetCharge(0, charge1[i]); out->SetCharge(1, charge2[i]); out->SetMotherPDG(PDGCode[i]); out->SetMotherMass(mass); out->SetPairCuts(cutsPair); // axis X: invmass (or resolution) if (useIM[i]) out->AddAxis(imID, 90, 0.6, 1.5); else out->AddAxis(resID, 200, -0.02, 0.02); // axis Y: transverse momentum out->AddAxis(ptID, 200, 0.0, 20.0); // axis Z: centrality-multiplicity if (!isPP) out->AddAxis(centID, 100, 0.0, 100.0); else out->AddAxis(centID, 400, 0.0, 400.0); // axis W: pseudorapidity // out->AddAxis(etaID, 20, -1.0, 1.0); // axis J: rapidity //out->AddAxis(yID, 90, -4.5, 4.5); } return kTRUE; }