Skip to content

Commit 9a27699

Browse files
committed
Histogram switches implemented
1 parent c6a0b1f commit 9a27699

File tree

1 file changed

+104
-115
lines changed

1 file changed

+104
-115
lines changed

PWGJE/Tasks/ChJetTriggerQATask.cxx

Lines changed: 104 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -91,79 +91,12 @@ struct ChJetTriggerQATask {
9191
Configurable<bool> bLowPtTrigger{"bLowPtTrigger", false, "charged jet low pT trigger selection"};
9292
Configurable<bool> bHighPtTrigger{"bHighPtTrigger", false, "charged jet high pT trigger selection"};
9393

94+
Configurable<bool> bAddSupplementHistosToOutput{"bAddAdditionalHistosToOutput", false, "add supplementary histos to the output"};
95+
Configurable<bool> bAddBigHistosToOutput{"bAddBigHistosToOutput", false, "add 3D histos to the output"};
96+
9497
float fiducialVolume; // 0.9 - jetR
9598

96-
HistogramRegistry spectra{
97-
"spectra",
98-
{
99-
{"vertexZ", "z vertex", {HistType::kTH1F, {{400, -20., +20.}}}}, //
100-
{"ptphiTrackInclGood",
101-
"pT vs phi inclusive good tracks",
102-
{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}}, //
103-
{"ptetaTrackInclGood",
104-
"pT vs eta inclusive good tracks",
105-
{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}}}, //
106-
{"phietaTrackAllInclGood",
107-
"phi vs eta all inclusive good tracks",
108-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
109-
{"phietaTrackHighPtInclGood",
110-
"phi vs eta inclusive good tracks with pT > 10 GeV",
111-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
112-
{"ptJetChInclFidVol",
113-
"inclusive charged jet pT in fiducial volume",
114-
{HistType::kTH1F, {{200, 0., +200.}}}}, //
115-
{"ptJetChInclFullVol",
116-
"inclusive charged jet pT in full volume",
117-
{HistType::kTH1F, {{200, 0., +200.}}}}, //
118-
{"ptphiJetChInclFidVol",
119-
"inclusive charged jet pT vs phi in fiducial volume",
120-
{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}}, //
121-
{"ptphiJetChInclFullVol",
122-
"inclusive charged jet pT vs phi in full TPC volume",
123-
{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}}, //
124-
{"ptetaJetChInclFidVol",
125-
"inclusive charged jet pT vs eta in fiducial volume",
126-
{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}}}, //
127-
{"phietaJetChInclFidVol",
128-
"inclusive charged jet phi vs eta in fiducial volume",
129-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
130-
{"phietaJetChInclFullVol",
131-
"inclusive charged jet phi vs eta in full TPC volume",
132-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
133-
{"phietaJetChInclHighPtFidVol",
134-
"inclusive charged jet phi vs eta in fiducial volume",
135-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
136-
{"phietaJetChInclHighPtFullVol",
137-
"inclusive charged jet phi vs eta in full TPC volume",
138-
{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}}}, //
139-
{"ptetaJetChInclFullVol",
140-
"inclusive charged jet pT vs eta in full TPC volume",
141-
{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}}}, //
142-
{"fLeadJetChPtVsLeadingTrack",
143-
"inclusive charged jet pT in TPC volume",
144-
{HistType::kTH2F, {{200, 0., +200.}, {200, 0., +200.}}}}, //
145-
{"ptetaLeadingTrack",
146-
"pT vs eta leading tracks",
147-
{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}}}, //
148-
{"ptphiLeadingTrack",
149-
"pT vs phi leading tracks",
150-
{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}}, //
151-
{"ptetaLeadingJet",
152-
"pT vs eta leading jet",
153-
{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}}}, //
154-
{"ptphiLeadingJet",
155-
"pT vs phi leading jet",
156-
{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}}}, //
157-
{"jetAreaFullVol",
158-
"area of all jets in full TPC volume",
159-
{HistType::kTH2F, {{100, 0., +100.}, {50, 0., 2.}}}}, //
160-
{"jetAreaFidVol",
161-
"area of all jets in fiducial volume",
162-
{HistType::kTH2F, {{100, 0., +100.}, {50, 0., 2.}}}}, //
163-
{"tracksThatWereNotJetConstituentsPtEtaPhi",
164-
"PtEtaPhi of tracksThatWereNotjetConsituents in full volume",
165-
{HistType::kTH3F, {{100, 0., +100.}, {40, -1., 1.}, {60, 0., TMath::TwoPi()}}}} //
166-
}};
99+
HistogramRegistry spectra;
167100

168101
int eventSelection = -1;
169102
int trackSelection = -1;
@@ -172,6 +105,41 @@ struct ChJetTriggerQATask {
172105
fiducialVolume = static_cast<float>(cfgTPCVolume) - static_cast<float>(cfgJetR);
173106
eventSelection = JetDerivedDataUtilities::initialiseEventSelection(static_cast<std::string>(evSel));
174107
trackSelection = JetDerivedDataUtilities::initialiseTrackSelection(static_cast<std::string>(trackSelections));
108+
109+
//Basic histos
110+
spectra.add("vertexZ", "z vertex", {HistType::kTH1F, {{400, -20., +20.}}});
111+
spectra.add("ptphiTrackInclGood","pT vs phi inclusive good tracks",{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}});
112+
spectra.add("ptetaTrackInclGood","pT vs eta inclusive good tracks",{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}});
113+
spectra.add("ptJetChInclFidVol","inclusive charged jet pT in fiducial volume",{HistType::kTH1F, {{200, 0., +200.}}});
114+
spectra.add("ptphiJetChInclFidVol","inclusive charged jet pT vs phi in fiducial volume",{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}});
115+
spectra.add("ptphiJetChInclFullVol","inclusive charged jet pT vs phi in full TPC volume",{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}});
116+
spectra.add("ptetaJetChInclFidVol","inclusive charged jet pT vs eta in fiducial volume",{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}});
117+
spectra.add("ptetaJetChInclFullVol","inclusive charged jet pT vs eta in full TPC volume",{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}});
118+
spectra.add("ptetaLeadingJetFullVol","pT vs eta leading jet",{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}});
119+
spectra.add("ptphiLeadingJetFullVol","pT vs phi leading jet",{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}});
120+
121+
//Supplementary plots
122+
if(bAddSupplementHistosToOutput){
123+
spectra.add("ptJetChInclFullVol","inclusive charged jet pT in full volume",{HistType::kTH1F, {{200, 0., +200.}}});
124+
spectra.add("phietaTrackAllInclGood","phi vs eta all inclusive good tracks",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
125+
spectra.add("phietaTrackHighPtInclGood","phi vs eta inclusive good tracks with pT > 10 GeV",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
126+
spectra.add("phietaJetChInclFidVol","inclusive charged jet phi vs eta in fiducial volume",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
127+
spectra.add("phietaJetChInclFullVol","inclusive charged jet phi vs eta in full TPC volume",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
128+
spectra.add("phietaJetChInclHighPtFidVol","inclusive charged jet phi vs eta in fiducial volume",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
129+
spectra.add("phietaJetChInclHighPtFullVol","inclusive charged jet phi vs eta in full TPC volume",{HistType::kTH2F, {{80, -1., 1.}, {60, 0, TMath::TwoPi()}}});
130+
spectra.add("ptetaLeadingTrack","pT vs eta leading tracks",{HistType::kTH2F, {{100, 0., +100.}, {80, -1., 1.}}});
131+
spectra.add("ptphiLeadingTrack","pT vs phi leading tracks",{HistType::kTH2F, {{100, 0., +100.}, {60, 0, TMath::TwoPi()}}});
132+
spectra.add("jetAreaFullVol","area of all jets in full TPC volume",{HistType::kTH2F, {{100, 0., +100.}, {50, 0., 2.}}});
133+
spectra.add("jetAreaFidVol","area of all jets in fiducial volume",{HistType::kTH2F, {{100, 0., +100.}, {50, 0., 2.}}});
134+
}
135+
136+
//3D histogram
137+
if(bAddBigHistosToOutput){
138+
spectra.add("fLeadJetChPtVsLeadingTrack","inclusive charged jet pT in TPC volume",{HistType::kTH2F, {{200, 0., +200.}, {200, 0., +200.}}});
139+
spectra.add("tracksThatWereNotJetConstituentsPtEtaPhi","PtEtaPhi of tracksThatWereNotjetConsituents in full volume",
140+
{HistType::kTH3F, {{100, 0., +100.}, {40, -1., 1.}, {60, 0., TMath::TwoPi()}}});
141+
}
142+
175143
}
176144

177145
// declare filters on collisions
@@ -196,11 +164,11 @@ struct ChJetTriggerQATask {
196164
return;
197165
}
198166

199-
if ((bLowPtTrigger && JetDerivedDataUtilities::selectChargedTrigger(collision, JetDerivedDataUtilities::JTrigSelCh::chargedLow)) || (bHighPtTrigger && JetDerivedDataUtilities::selectChargedTrigger(collision, JetDerivedDataUtilities::JTrigSelCh::chargedHigh)) || ((!bLowPtTrigger) && (!bHighPtTrigger))) {
200-
// bLowPtTrigger=1 and bHighPtTrigger=0 --> fill histos with low trigger only
201-
// bLowPtTrigger=0 and bHighPtTrigger=1 --> fill histos with high trigger only
202-
// bLowPtTrigger=1 and bHighPtTrigger=1 --> fill histos with mixture of low and high trigger
203-
// bLowPtTrigger=0 and bHighPtTrigger=0 --> fill histos with minimum bias ie. ignore trigger decision
167+
if ((bLowPtTrigger && JetDerivedDataUtilities::selectChargedTrigger(collision, JetDerivedDataUtilities::JTrigSelCh::chargedLow)) || (bHighPtTrigger && JetDerivedDataUtilities::selectChargedTrigger(collision, JetDerivedDataUtilities::JTrigSelCh::chargedHigh)) || ((!bLowPtTrigger)&&(!bHighPtTrigger))) {
168+
//bLowPtTrigger=1 and bHighPtTrigger=0 --> fill histos with low trigger only
169+
//bLowPtTrigger=0 and bHighPtTrigger=1 --> fill histos with high trigger only
170+
//bLowPtTrigger=1 and bHighPtTrigger=1 --> fill histos with mixture of low and high trigger
171+
//bLowPtTrigger=0 and bHighPtTrigger=0 --> fill histos with minimum bias ie. ignore trigger decision
204172

205173
float leadingJetPt = -1.0;
206174
float leadingJetEta = -2.0;
@@ -222,8 +190,11 @@ struct ChJetTriggerQATask {
222190
if (!JetDerivedDataUtilities::selectTrack(trk, trackSelection)) {
223191
continue;
224192
}
225-
v.SetPtEtaPhiM(trk.pt(), trk.eta(), trk.phi(), 0.139);
226-
acceptedTracks.push_back(GoodTrack(v, false, trk.globalIndex()));
193+
194+
if(bAddBigHistosToOutput){
195+
v.SetPtEtaPhiM(trk.pt(), trk.eta(), trk.phi(), 0.139);
196+
acceptedTracks.push_back(GoodTrack(v, false, trk.globalIndex()));
197+
}
227198

228199
spectra.fill(
229200
HIST("ptphiTrackInclGood"), trk.pt(),
@@ -232,14 +203,16 @@ struct ChJetTriggerQATask {
232203
HIST("ptetaTrackInclGood"), trk.pt(),
233204
trk.eta()); // Inclusive Track pT vs eta spectrum in TPC volume
234205

235-
spectra.fill(
236-
HIST("phietaTrackAllInclGood"), trk.eta(),
237-
trk.phi()); // Inclusive Track pT vs eta spectrum in TPC volume
238-
239-
if (trk.pt() > 5.0) {
206+
if(bAddSupplementHistosToOutput){
240207
spectra.fill(
241-
HIST("phietaTrackHighPtInclGood"), trk.eta(),
208+
HIST("phietaTrackAllInclGood"), trk.eta(),
242209
trk.phi()); // Inclusive Track pT vs eta spectrum in TPC volume
210+
211+
if (trk.pt() > 5.0) {
212+
spectra.fill(
213+
HIST("phietaTrackHighPtInclGood"), trk.eta(),
214+
trk.phi()); // Inclusive Track pT vs eta spectrum in TPC volume
215+
}
243216
}
244217

245218
if (trk.pt() >
@@ -250,11 +223,14 @@ struct ChJetTriggerQATask {
250223
}
251224
}
252225

253-
if (leadingTrackPt > -1.) {
254-
spectra.fill(HIST("ptphiLeadingTrack"), leadingTrackPt,
255-
leadingTrackPhi);
256-
spectra.fill(HIST("ptetaLeadingTrack"), leadingTrackPt,
257-
leadingTrackEta);
226+
227+
if(bAddSupplementHistosToOutput){
228+
if (leadingTrackPt > -1.) {
229+
spectra.fill(HIST("ptphiLeadingTrack"), leadingTrackPt,
230+
leadingTrackPhi);
231+
spectra.fill(HIST("ptetaLeadingTrack"), leadingTrackPt,
232+
leadingTrackEta);
233+
}
258234
}
259235

260236
// Find leading jet pT in full TPC volume
@@ -268,32 +244,38 @@ struct ChJetTriggerQATask {
268244
}
269245

270246
// access jet constituents as tracks
271-
for (auto& jct : jet.tracks_as<TrackCandidates>()) {
272-
for (UInt_t itr = 0; itr < acceptedTracks.size(); itr++) {
273-
if (acceptedTracks[itr].globalIndex == jct.globalIndex()) {
274-
275-
acceptedTracks[itr].isJetConstituent = true; // initialization
276-
break;
247+
if(bAddBigHistosToOutput){
248+
for (auto& jct : jet.tracks_as<TrackCandidates>()) {
249+
for (UInt_t itr = 0; itr < acceptedTracks.size(); itr++) {
250+
if (acceptedTracks[itr].globalIndex == jct.globalIndex()) {
251+
252+
acceptedTracks[itr].isJetConstituent = true; // initialization
253+
break;
254+
}
277255
}
278256
}
279-
}
257+
}
280258
}
281259
}
282260

283-
for (UInt_t itr = 0; itr < acceptedTracks.size(); itr++) {
284-
if (!acceptedTracks[itr].isJetConstituent) {
285-
spectra.fill(HIST("tracksThatWereNotJetConstituentsPtEtaPhi"), acceptedTracks[itr].lv.Pt(), acceptedTracks[itr].lv.Eta(), TVector2::Phi_0_2pi(acceptedTracks[itr].lv.Phi()));
261+
if(bAddBigHistosToOutput){
262+
for (UInt_t itr = 0; itr < acceptedTracks.size(); itr++) {
263+
if (!acceptedTracks[itr].isJetConstituent) {
264+
spectra.fill(HIST("tracksThatWereNotJetConstituentsPtEtaPhi"), acceptedTracks[itr].lv.Pt(), acceptedTracks[itr].lv.Eta(), TVector2::Phi_0_2pi(acceptedTracks[itr].lv.Phi()));
265+
}
286266
}
287267
}
288268

289269
if (leadingJetPt > -1.) {
290-
spectra.fill(HIST("ptphiLeadingJet"), leadingJetPt, leadingJetPhi);
291-
spectra.fill(HIST("ptetaLeadingJet"), leadingJetPt, leadingJetEta);
270+
spectra.fill(HIST("ptphiLeadingJetFullVol"), leadingJetPt, leadingJetPhi);
271+
spectra.fill(HIST("ptetaLeadingJetFullVol"), leadingJetPt, leadingJetEta);
292272
}
293273

294-
if (leadingJetPt > -1. && leadingTrackPt > -1.) {
295-
spectra.fill(HIST("fLeadJetChPtVsLeadingTrack"), leadingTrackPt,
296-
leadingJetPt); // leading jet pT versus leading track pT
274+
if(bAddBigHistosToOutput){
275+
if (leadingJetPt > -1. && leadingTrackPt > -1.) {
276+
spectra.fill(HIST("fLeadJetChPtVsLeadingTrack"), leadingTrackPt,
277+
leadingJetPt); // leading jet pT versus leading track pT
278+
}
297279
}
298280

299281
// Inclusive Jet pT spectrum in Fiducial volume
@@ -302,22 +284,29 @@ struct ChJetTriggerQATask {
302284
spectra.fill(HIST("ptJetChInclFidVol"), jet.pt());
303285
spectra.fill(HIST("ptphiJetChInclFidVol"), jet.pt(), jet.phi());
304286
spectra.fill(HIST("ptetaJetChInclFidVol"), jet.pt(), jet.eta());
305-
spectra.fill(HIST("phietaJetChInclFidVol"), jet.eta(), jet.phi());
306-
if (jet.pt() > 10.0) {
307-
spectra.fill(HIST("phietaJetChInclHighPtFidVol"), jet.eta(), jet.phi());
308-
}
309-
spectra.fill(HIST("jetAreaFidVol"), jet.pt(), jet.area());
287+
288+
if(bAddSupplementHistosToOutput){
289+
spectra.fill(HIST("phietaJetChInclFidVol"), jet.eta(), jet.phi());
290+
if (jet.pt() > 10.0) {
291+
spectra.fill(HIST("phietaJetChInclHighPtFidVol"), jet.eta(), jet.phi());
292+
}
293+
spectra.fill(HIST("jetAreaFidVol"), jet.pt(), jet.area());
294+
}
310295
}
311296

312297
if (fabs(jet.eta()) < static_cast<float>(cfgTPCVolume)) {
313-
spectra.fill(HIST("ptJetChInclFullVol"), jet.pt());
314298
spectra.fill(HIST("ptphiJetChInclFullVol"), jet.pt(), jet.phi());
315299
spectra.fill(HIST("ptetaJetChInclFullVol"), jet.pt(), jet.eta());
316-
spectra.fill(HIST("phietaJetChInclFullVol"), jet.eta(), jet.phi());
317-
if (jet.pt() > 10.0) {
318-
spectra.fill(HIST("phietaJetChInclHighPtFullVol"), jet.eta(), jet.phi());
319-
}
320-
spectra.fill(HIST("jetAreaFullVol"), jet.pt(), jet.area());
300+
301+
if(bAddSupplementHistosToOutput){
302+
spectra.fill(HIST("ptJetChInclFullVol"), jet.pt());
303+
304+
spectra.fill(HIST("phietaJetChInclFullVol"), jet.eta(), jet.phi());
305+
if (jet.pt() > 10.0) {
306+
spectra.fill(HIST("phietaJetChInclHighPtFullVol"), jet.eta(), jet.phi());
307+
}
308+
spectra.fill(HIST("jetAreaFullVol"), jet.pt(), jet.area());
309+
}
321310
}
322311
}
323312
}

0 commit comments

Comments
 (0)