Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeavyIon Reaction Plane MiniAOD #31129

Merged
merged 5 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions DQM/Physics/src/CentralityDQM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,11 @@ void CentralityDQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&, edm:

Double_t psirange = 4;
bei.setCurrentFolder("Physics/Centrality/EventPlane/");
h_ep_HFm1 = bei.book1D("h_ep_HFm1", "h_ep_HFm1", 800, -psirange, psirange);
h_ep_HFp1 = bei.book1D("h_ep_HFp1", "h_ep_HFp1", 800, -psirange, psirange);
h_ep_trackm1 = bei.book1D("h_ep_trackm1", "h_ep_trackm1", 800, -psirange, psirange);
h_ep_trackp1 = bei.book1D("h_ep_trackp1", "h_ep_trackp1", 800, -psirange, psirange);
h_ep_castor1 = bei.book1D("h_ep_castor1", "h_ep_castor1", 800, -psirange, psirange);
h_ep_HFm2 = bei.book1D("h_ep_HFm2", "h_ep_HFm2", 800, -psirange, psirange);
h_ep_HFp2 = bei.book1D("h_ep_HFp2", "h_ep_HFp2", 800, -psirange, psirange);
h_ep_trackmid2 = bei.book1D("h_ep_trackmid2", "h_ep_trackmid2", 800, -psirange, psirange);
h_ep_trackm2 = bei.book1D("h_ep_trackm2", "h_ep_trackm2", 800, -psirange, psirange);
h_ep_trackp2 = bei.book1D("h_ep_trackp2", "h_ep_trackp2", 800, -psirange, psirange);
h_ep_castor2 = bei.book1D("h_ep_castor2", "h_ep_castor2", 800, -psirange, psirange);
h_ep_HFm3 = bei.book1D("h_ep_HFm3", "h_ep_HFm3", 800, -psirange, psirange);
h_ep_HFp3 = bei.book1D("h_ep_HFp3", "h_ep_HFp3", 800, -psirange, psirange);
h_ep_trackmid3 = bei.book1D("h_ep_trackmid3", "h_ep_trackmid3", 800, -psirange, psirange);
Expand Down Expand Up @@ -172,18 +166,11 @@ void CentralityDQM::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe
if (ep.isValid()) {
EvtPlaneCollection::const_iterator rp = ep->begin();

h_ep_HFm1->Fill(rp[HFm1].angle(0));
h_ep_HFp1->Fill(rp[HFp1].angle(0));
h_ep_trackm1->Fill(rp[trackm1].angle(0));
h_ep_trackp1->Fill(rp[trackp1].angle(0));
h_ep_castor1->Fill(rp[Castor1].angle(0));

h_ep_HFm2->Fill(rp[HFm2].angle(0));
h_ep_HFp2->Fill(rp[HFp2].angle(0));
h_ep_trackmid2->Fill(rp[trackmid2].angle(0));
h_ep_trackm2->Fill(rp[trackm2].angle(0));
h_ep_trackp2->Fill(rp[trackp2].angle(0));
h_ep_castor2->Fill(rp[Castor2].angle(0));

h_ep_HFm3->Fill(rp[HFm3].angle(0));
h_ep_HFp3->Fill(rp[HFp3].angle(0));
Expand Down
7 changes: 0 additions & 7 deletions DQM/Physics/src/CentralityDQM.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,11 @@ class CentralityDQM : public DQMEDAnalyzer {

MonitorElement* h_cent_bin;

MonitorElement* h_ep_HFm1;
MonitorElement* h_ep_HFp1;
MonitorElement* h_ep_trackm1;
MonitorElement* h_ep_trackp1;
MonitorElement* h_ep_castor1;

MonitorElement* h_ep_HFm2;
MonitorElement* h_ep_HFp2;
MonitorElement* h_ep_trackmid2;
MonitorElement* h_ep_trackm2;
MonitorElement* h_ep_trackp2;
MonitorElement* h_ep_castor2;

MonitorElement* h_ep_HFm3;
MonitorElement* h_ep_HFp3;
Expand Down
17 changes: 0 additions & 17 deletions DQM/Physics/src/CentralitypADQM.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ class CentralitypADQM : public DQMEDAnalyzer {
MonitorElement* h_vertex_z;

MonitorElement* h_cent_bin;

MonitorElement* h_ep_HFm1;
MonitorElement* h_ep_HFp1;
MonitorElement* h_ep_trackm1;
MonitorElement* h_ep_trackp1;
MonitorElement* h_ep_castor1;

MonitorElement* h_ep_HFm2;
MonitorElement* h_ep_HFp2;
MonitorElement* h_ep_trackmid2;
MonitorElement* h_ep_trackm2;
MonitorElement* h_ep_trackp2;
MonitorElement* h_ep_castor2;

MonitorElement* h_ep_HFm3;
MonitorElement* h_ep_HFp3;
MonitorElement* h_ep_trackmid3;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
'keep *_l1extraParticles_*_*',
'keep L1GlobalTriggerReadoutRecord_gtDigis_*_*',
# stage 2 L1 trigger
'keep *_gtStage2Digis__*',
'keep *_gtStage2Digis__*',
'keep *_gmtStage2Digis_Muon_*',
'keep *_caloStage2Digis_Jet_*',
'keep *_caloStage2Digis_Tau_*',
Expand Down Expand Up @@ -100,7 +100,7 @@
'keep GenLumiInfoHeader_generator_*_*',
'keep GenLumiInfoProduct_*_*_*',
'keep GenEventInfoProduct_generator_*_*',
'keep recoGenParticles_genPUProtons_*_*',
'keep recoGenParticles_genPUProtons_*_*',
'keep *_slimmedGenJetsFlavourInfos_*_*',
'keep *_slimmedGenJets__*',
'keep *_slimmedGenJetsAK8__*',
Expand Down Expand Up @@ -136,7 +136,7 @@
_run3_common_extraCommands = ["drop *_packedPFCandidates_hcalDepthEnergyFractions_*"]
from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toModify(MicroEventContent, outputCommands = MicroEventContent.outputCommands + _run3_common_extraCommands)
# ---
# ---

_pp_on_AA_extraCommands = [
'keep patPackedCandidates_hiPixelTracks_*_*',
Expand All @@ -147,6 +147,8 @@
'keep recoCentrality_hiCentrality_*_*',
'keep int_centralityBin_*_*',
'keep recoHFFilterInfo_hiHFfilters_*_*',
'keep *_hiEvtPlane_*_*',
'keep *_hiEvtPlaneFlat_*_*'
]
from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3
Expand Down
7 changes: 5 additions & 2 deletions PhysicsTools/PatAlgos/python/slimming/slimming_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@
pp_on_AA_2018.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons]))
from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3
from PhysicsTools.PatAlgos.slimming.hiPixelTracks_cfi import hiPixelTracks
(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks))
from RecoHI.HiEvtPlaneAlgos.HiEvtPlane_cfi import hiEvtPlane
from RecoHI.HiEvtPlaneAlgos.hiEvtPlaneFlat_cfi import hiEvtPlaneFlat
(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks,
hiEvtPlane, hiEvtPlaneFlat))

from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3
from PhysicsTools.PatAlgos.packedCandidateMuonID_cfi import packedCandidateMuonID
Expand All @@ -76,7 +79,7 @@
from RecoHI.HiCentralityAlgos.hiHFfilters_cfi import hiHFfilters
lostTrackChi2 = packedPFCandidateTrackChi2.clone(candidates = "lostTracks", doLostTracks = True)
(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(
slimmingTask,
slimmingTask,
cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters))

from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
Expand Down
1 change: 1 addition & 0 deletions RecoHI/HiEvtPlaneAlgos/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/Candidate"/>
<use name="DataFormats/HcalRecHit"/>
<use name="DataFormats/TrackReco"/>
Expand Down
168 changes: 168 additions & 0 deletions RecoHI/HiEvtPlaneAlgos/interface/EPCuts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#ifndef RecoHI_HiEvtPlaneAlgos_EPCuts_h
#define RecoHI_HiEvtPlaneAlgos_EPCuts_h

namespace hi {

enum class EP_ERA { ppReco, HIReco, Pixel, GenMC };

struct TrackStructure {
int centbin;
float eta;
float phi;
float et;
float pt;
int charge;
int pdgid;
int hits;
int algos;
int collection;
float dz;
float dxy;
float dzError;
float dxyError;
float ptError;
bool highPurity;
float dzSig;
float dxySig;
float normalizedChi2;
float dzError_Pix;
float chi2layer;
int numberOfValidHits;
int pixel;
};

class EPCuts {
public:
explicit EPCuts(EP_ERA cutEra = EP_ERA::ppReco,
double pterror = 0.1,
double dzerror = 3.0,
double dxyerror = 3.0,
double chi2perlayer = 0.18,
double dzError_Pix = 10.0,
double chi2Pix = 40.,
int numberOfValidHits = 11) {
cutera_ = cutEra;
pterror_ = pterror;
dzerror_ = dzerror;
dxyerror_ = dxyerror;
chi2perlayer_ = chi2perlayer;
dzerror_Pix_ = dzError_Pix;
chi2Pix_ = chi2Pix;
numberOfValidHits_ = numberOfValidHits;
}

bool isGoodHF(const TrackStructure& track) const {
if (track.pdgid != 1 && track.pdgid != 2)
return false;
if (std::abs(track.eta) < 3 || std::abs(track.eta) > 5)
return false;
return true;
}

bool isGoodCastor(const TrackStructure& track) const { return true; }

bool isGoodTrack(const TrackStructure& track) const {
if (cutera_ == EP_ERA::ppReco)
return trackQuality_ppReco(track);
if (cutera_ == EP_ERA::HIReco)
return trackQuality_HIReco(track);
if (cutera_ == EP_ERA::Pixel)
return trackQuality_Pixel(track);
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about GenMC case? It looks like trackQuality_GenMC returns some non-false values.
Is it intentionally omitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not used now for MC, but may be used later.

}

bool trackQuality_ppReco(const TrackStructure& track) const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and other methods have a fairly large overlap in implementation.
Unless there are good reasons to maintain copy-pasted separately implemented selections, appropriate grouping should be done to reduce repeated code.

Also, the methods will be easier to use in general if there was only a method accepting the cutEra as a function argument bool trackQuality(const TrackStructure& track, EP_ERA cutEra);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are prepared for different HI data taking and scenario. We prefer to separate them to make it easy for copy and paste.

if (track.charge == 0)
return false;
if (!track.highPurity)
return false;
if (track.ptError > pterror_ * track.pt)
return false;
if (track.numberOfValidHits < numberOfValidHits_)
return false;
if (track.chi2layer > chi2perlayer_)
return false;
if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
return false;
if (std::abs(track.dz) > dzerror_ * track.dzError)
return false;
return true;
}

bool trackQuality_HIReco(const TrackStructure& track) const {
if (track.charge == 0)
return false;
if (!track.highPurity)
return false;
if (track.numberOfValidHits < numberOfValidHits_)
return false;
if (track.ptError > pterror_ * track.pt)
return false;
if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
return false;
if (std::abs(track.dz) > dzerror_ * track.dzError)
return false;
if (track.chi2layer > chi2perlayer_)
return false;
//if (track.algos != 4 && track.algos != 5 && track.algos != 6 && track.algos != 7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this commented out code needed?
Please remove or add comments inline in the code why the commented out block is relevant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Various HI documents used algo numbers instead of the enum names. We keep it for documentation purpose.

if (track.algos != reco::TrackBase::initialStep && track.algos != reco::TrackBase::lowPtTripletStep &&
track.algos != reco::TrackBase::pixelPairStep && track.algos != reco::TrackBase::detachedTripletStep)
return false;
return true;
}

bool trackQuality_Pixel(const TrackStructure& track) const {
if (track.charge == 0)
return false;
if (!track.highPurity)
return false;
bool bPix = false;
int nHits = track.numberOfValidHits;
if (track.ptError > pterror_ * track.pt)
return false;
if (track.pt < 2.4 and (nHits <= 6))
bPix = true;
if (not bPix) {
if (nHits < numberOfValidHits_)
return false;
if (track.chi2layer > chi2perlayer_)
return false;
if (track.ptError > pterror_ * track.pt)
return false;
int algo = track.algos;
if (track.pt > 2.4 && algo != reco::TrackBase::initialStep && algo != reco::TrackBase::lowPtTripletStep &&
algo != reco::TrackBase::pixelPairStep && algo != reco::TrackBase::detachedTripletStep)
return false;
if (std::abs(track.dxy) > dxyerror_ * track.dxyError)
return false;
if (std::abs(track.dz) > dzerror_ * track.dzError)
return false;
} else {
if (track.chi2layer > chi2Pix_)
return false;
if (std::abs(track.dz) > dzerror_Pix_ * track.dzError)
return false;
}
return true;
}

bool trackQuality_GenMC(const TrackStructure& track) const {
if (track.charge == 0)
return false;
if (std::abs(track.eta) > 2.4)
return false;
return true;
}

private:
EP_ERA cutera_;
double pterror_;
double dzerror_;
double dxyerror_;
double chi2perlayer_;
double dzerror_Pix_;
double chi2Pix_;
int numberOfValidHits_;
};
} // namespace hi
#endif
Loading