Skip to content

Commit 3cc0d53

Browse files
author
Carlo Battilana
committed
Add further information for GEM and RPC MUODPG BKG ntuples and for DT ZMu ntuples
1 parent 65da010 commit 3cc0d53

File tree

8 files changed

+106
-6
lines changed

8 files changed

+106
-6
lines changed

Configuration/PyReleaseValidation/python/relval_nano.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def next(self, index: int = None) -> None:
265265
steps['muDPGNANO_data14.0'] = merge([{'-s': 'RAW2DIGI,NANO:@MUDPG', '-n': '100'},
266266
steps['NANO_data14.0']])
267267

268-
steps['muDPGNANOBkg_data14.0'] = merge([{'-s': 'RAW2DIGI,NANO:@MUDPGBKG', '-n': '100'},
268+
steps['muDPGNANOBkg_data14.0'] = merge([{'-s': 'RAW2DIGI,RECO:localreco,NANO:@MUDPGBKG', '-n': '100'},
269269
steps['NANO_data14.0']])
270270

271271
steps['hcalDPGNANO_data14.0'] = merge([{'-s': 'RAW2DIGI,RECO,NANO:@HCAL', '-n': '100',

DPGAnalysis/MuonTools/plugins/BuildFile.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<library name="DPGAnalysisMuonToolsPlugin" file="*.cc">
22
<use name="DataFormats/RPCRecHit"/>
3+
<use name="DataFormats/TCDS"/>
34
<use name="FWCore/Framework"/>
45
<use name="FWCore/PluginManager"/>
56
<use name="FWCore/ParameterSet"/>

DPGAnalysis/MuonTools/plugins/MuDTSegmentExtTableProducer.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ void MuDTSegmentExtTableProducer::fillTable(edm::Event& ev) {
146146
std::vector<float> seg4D_hitsExpPos;
147147
std::vector<float> seg4D_hitsExpPosCh;
148148
std::vector<int16_t> seg4D_hitsExpWire;
149+
std::vector<int16_t> seg4D_hitsExpLayer;
150+
std::vector<int16_t> seg4D_hitsExpSuperLayer;
149151

150152
// rec-hits vectors, filled if m_fillHits == true
151153
unsigned int nHits{0};
@@ -258,6 +260,9 @@ void MuDTSegmentExtTableProducer::fillTable(edm::Event& ev) {
258260

259261
bool success{ppt.first}; // check for failure
260262

263+
seg4D_hitsExpSuperLayer.push_back(iSL);
264+
seg4D_hitsExpLayer.push_back(iL);
265+
261266
auto expPos{DEFAULT_DOUBLE_VAL};
262267
auto expPosCh{DEFAULT_DOUBLE_VAL};
263268
auto expWire{DEFAULT_INT_VAL_POS};
@@ -351,18 +356,21 @@ void MuDTSegmentExtTableProducer::fillTable(edm::Event& ev) {
351356
auto tabExtr = std::make_unique<nanoaod::FlatTable>(nExtr, m_name + "_extr", false, false);
352357

353358
tabExtr->setDoc("Size of DT segment *_extr_* vectors");
359+
addColumn(tabExtr,
360+
"ExpSuperLayer",
361+
seg4D_hitsExpSuperLayer,
362+
"expected superlayer of an extrapolated segment - [1:3] range");
363+
addColumn(tabExtr, "ExpLayer", seg4D_hitsExpLayer, "expected layer of an extrapolated segment - [1:4] range");
354364
addColumn(tabExtr,
355365
"ExpPos",
356366
seg4D_hitsExpPos,
357367
"expected position of segment extrapolated"
358368
"<br />to a given layer in layer local coordinates - cm");
359-
360369
addColumn(tabExtr,
361370
"ExpPosCh",
362371
seg4D_hitsExpPosCh,
363372
"expected position of segment extrapolated"
364373
"<br />to a given layer in chhamber local coordinates - cm");
365-
366374
addColumn(tabExtr,
367375
"ExpWire",
368376
seg4D_hitsExpWire,
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/** \class MuGEML1FETableProducer MuGEML1FETableProducer.cc DPGAnalysis/MuonTools/src/MuGEML1FETableProducer.cc
2+
*
3+
* Helper class : FlatTableProducer for GEM Flower Event (reading FED RAW Data)
4+
*
5+
* \author Jeewon Heo
6+
* based on code written by C.Battilana (INFN BO)
7+
*
8+
*/
9+
10+
//#include "FWCore/ParameterSet/interface/allowedValues.h"
11+
#include "FWCore/PluginManager/interface/ModuleDef.h"
12+
#include "FWCore/Framework/interface/MakerMacros.h"
13+
14+
#include <iostream>
15+
#include <vector>
16+
17+
#include "DPGAnalysis/MuonTools/interface/MuBaseFlatTableProducer.h"
18+
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
19+
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
20+
#include "FWCore/Framework/interface/ConsumesCollector.h"
21+
#include "DataFormats/TCDS/interface/TCDSRecord.h"
22+
23+
class MuGEML1FETableProducer : public MuBaseFlatTableProducer {
24+
public:
25+
/// Constructor
26+
MuGEML1FETableProducer(const edm::ParameterSet&);
27+
28+
/// Fill descriptors
29+
static void fillDescriptions(edm::ConfigurationDescriptions&);
30+
31+
protected:
32+
/// Fill tree branches for a given event
33+
void fillTable(edm::Event&) final;
34+
35+
/// Get info from the ES by run
36+
void getFromES(const edm::Run&, const edm::EventSetup&) final;
37+
38+
private:
39+
nano_mu::EDTokenHandle<TCDSRecord> m_token;
40+
static constexpr int BX_IN_ORBIT = 3564;
41+
};
42+
43+
MuGEML1FETableProducer::MuGEML1FETableProducer(const edm::ParameterSet& config)
44+
: MuBaseFlatTableProducer{config}, m_token{config, consumesCollector(), "src"} {
45+
produces<nanoaod::FlatTable>();
46+
}
47+
48+
void MuGEML1FETableProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
49+
edm::ParameterSetDescription desc;
50+
51+
desc.add<std::string>("name", "l1aHistory");
52+
desc.add<edm::InputTag>("src", edm::InputTag{"tcdsDigis:tcdsRecord"});
53+
54+
descriptions.addWithDefaultLabel(desc);
55+
}
56+
57+
void MuGEML1FETableProducer::getFromES(const edm::Run& run, const edm::EventSetup& environment) {}
58+
59+
void MuGEML1FETableProducer::fillTable(edm::Event& ev) {
60+
std::vector<int> bxDiffs;
61+
62+
auto record = m_token.conditionalGet(ev);
63+
64+
// in Heavy Ion Physics the getL1aHistoryEntry is not saved ...
65+
// comment out and use this as proxy to inquire BX,Orbit and Lumi
66+
for (const auto l1aEntry : record->getFullL1aHistory()) {
67+
int bxDiff = BX_IN_ORBIT * (record->getOrbitNr() - l1aEntry.getOrbitNr()) + record->getBXID() - l1aEntry.getBXID();
68+
bxDiffs.push_back(bxDiff);
69+
}
70+
71+
auto table = std::make_unique<nanoaod::FlatTable>(bxDiffs.size(), m_name, false, false);
72+
addColumn(table, "bxDiffs", bxDiffs, "BX differences between event and L1As");
73+
74+
ev.put(std::move(table));
75+
}
76+
77+
DEFINE_FWK_MODULE(MuGEML1FETableProducer);

DPGAnalysis/MuonTools/python/muNtupleProducerBkg_cff.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
from DPGAnalysis.MuonTools.nano_mu_global_cff import *
66
from DPGAnalysis.MuonTools.nano_mu_digi_cff import *
7+
from DPGAnalysis.MuonTools.nano_mu_local_reco_cff import *
8+
from DPGAnalysis.MuonTools.nano_mu_reco_cff import *
79

810
muDPGNanoProducerBkg = cms.Sequence(globalTables
9-
+ muDigiTablesBkg)
11+
+ muDigiTablesBkg
12+
+ muLocalRecoTablesBkg)
1013

1114
def muDPGNanoBkgCustomize(process) :
1215

DPGAnalysis/MuonTools/python/nano_mu_global_cff.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
doc = cms.string("Online luminosity information"),
1010
variables = cms.PSet(
1111
instLumi = Var( "instLumi()", "double", doc = "Instantaneous luminosity"),
12-
avgPileUp = Var( "avgPileUp()", "double", doc = "Average PU")
12+
avgPileUp = Var( "avgPileUp()", "double", doc = "Average PU"),
13+
timestamp = Var( "timestamp().unixTime()", "uint", doc = "Time Stamp")
1314
)
1415
)
1516

16-
globalTables = cms.Sequence(lumiTable + lhcInfoTable)
17+
from DPGAnalysis.MuonTools.muGEML1FETableProducer_cfi import muGEML1FETableProducer
18+
19+
muGEML1FETable = muGEML1FETableProducer.clone()
20+
21+
globalTables = cms.Sequence(lumiTable + lhcInfoTable + muGEML1FETable)

DPGAnalysis/MuonTools/python/nano_mu_local_reco_cff.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,8 @@
231231
+ muDTSegmentExtTable
232232
+ gemSegmentFlatTable
233233
)
234+
235+
muLocalRecoTablesBkg = cms.Sequence(rpcRecHitFlatTable
236+
+ gemRecHitFlatTable
237+
+ dtSegmentFlatTable
238+
)

PhysicsTools/NanoAOD/plugins/LHCInfoProducer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class LHCInfoProducer : public edm::global::EDProducer<edm::BeginLuminosityBlock
7070
out->addFloat("crossingAngle", "LHC crossing angle", lhcInfoCombined.crossingAngle());
7171
out->addFloat("betaStar", "LHC beta star", lhcInfoCombined.betaStarX);
7272
out->addFloat("energy", "LHC beam energy", lhcInfoCombined.energy);
73+
out->addInt("fill", "LHC fill number", lhcInfoCombined.fillNumber);
7374
iLumi.put(std::move(out));
7475
}
7576

0 commit comments

Comments
 (0)