Skip to content
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
2 changes: 1 addition & 1 deletion Configuration/PyReleaseValidation/python/relval_nano.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def next(self, index: int = None) -> None:
steps['muDPGNANO_data14.0'] = merge([{'-s': 'RAW2DIGI,NANO:@MUDPG', '-n': '100'},
steps['NANO_data14.0']])

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

steps['hcalDPGNANO_data14.0'] = merge([{'-s': 'RAW2DIGI,RECO,NANO:@HCAL', '-n': '100',
Expand Down
1 change: 1 addition & 0 deletions DPGAnalysis/MuonTools/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<library name="DPGAnalysisMuonToolsPlugin" file="*.cc">
<use name="DataFormats/RPCRecHit"/>
<use name="DataFormats/TCDS"/>
<use name="FWCore/Framework"/>
<use name="FWCore/PluginManager"/>
<use name="FWCore/ParameterSet"/>
Expand Down
12 changes: 10 additions & 2 deletions DPGAnalysis/MuonTools/plugins/MuDTSegmentExtTableProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ void MuDTSegmentExtTableProducer::fillTable(edm::Event& ev) {
std::vector<float> seg4D_hitsExpPos;
std::vector<float> seg4D_hitsExpPosCh;
std::vector<int16_t> seg4D_hitsExpWire;
std::vector<int16_t> seg4D_hitsExpLayer;
std::vector<int16_t> seg4D_hitsExpSuperLayer;

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

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

seg4D_hitsExpSuperLayer.push_back(iSL);
seg4D_hitsExpLayer.push_back(iL);

auto expPos{DEFAULT_DOUBLE_VAL};
auto expPosCh{DEFAULT_DOUBLE_VAL};
auto expWire{DEFAULT_INT_VAL_POS};
Expand Down Expand Up @@ -351,18 +356,21 @@ void MuDTSegmentExtTableProducer::fillTable(edm::Event& ev) {
auto tabExtr = std::make_unique<nanoaod::FlatTable>(nExtr, m_name + "_extr", false, false);

tabExtr->setDoc("Size of DT segment *_extr_* vectors");
addColumn(tabExtr,
"ExpSuperLayer",
seg4D_hitsExpSuperLayer,
"expected superlayer of an extrapolated segment - [1:3] range");
addColumn(tabExtr, "ExpLayer", seg4D_hitsExpLayer, "expected layer of an extrapolated segment - [1:4] range");
addColumn(tabExtr,
"ExpPos",
seg4D_hitsExpPos,
"expected position of segment extrapolated"
"<br />to a given layer in layer local coordinates - cm");

addColumn(tabExtr,
"ExpPosCh",
seg4D_hitsExpPosCh,
"expected position of segment extrapolated"
"<br />to a given layer in chhamber local coordinates - cm");

addColumn(tabExtr,
"ExpWire",
seg4D_hitsExpWire,
Expand Down
77 changes: 77 additions & 0 deletions DPGAnalysis/MuonTools/plugins/MuGEML1FETableProducer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/** \class MuGEML1FETableProducer MuGEML1FETableProducer.cc DPGAnalysis/MuonTools/src/MuGEML1FETableProducer.cc
*
* Helper class : FlatTableProducer for GEM Flower Event (reading FED RAW Data)
*
* \author Jeewon Heo
* based on code written by C.Battilana (INFN BO)
*
*/

//#include "FWCore/ParameterSet/interface/allowedValues.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include <iostream>
#include <vector>

#include "DPGAnalysis/MuonTools/interface/MuBaseFlatTableProducer.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "DataFormats/TCDS/interface/TCDSRecord.h"

class MuGEML1FETableProducer : public MuBaseFlatTableProducer {
public:
/// Constructor
MuGEML1FETableProducer(const edm::ParameterSet&);

/// Fill descriptors
static void fillDescriptions(edm::ConfigurationDescriptions&);

protected:
/// Fill tree branches for a given event
void fillTable(edm::Event&) final;

/// Get info from the ES by run
void getFromES(const edm::Run&, const edm::EventSetup&) final;

private:
nano_mu::EDTokenHandle<TCDSRecord> m_token;
static constexpr int BX_IN_ORBIT = 3564;
};

MuGEML1FETableProducer::MuGEML1FETableProducer(const edm::ParameterSet& config)
: MuBaseFlatTableProducer{config}, m_token{config, consumesCollector(), "src"} {
produces<nanoaod::FlatTable>();
}

void MuGEML1FETableProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;

desc.add<std::string>("name", "l1aHistory");
desc.add<edm::InputTag>("src", edm::InputTag{"tcdsDigis:tcdsRecord"});

descriptions.addWithDefaultLabel(desc);
}

void MuGEML1FETableProducer::getFromES(const edm::Run& run, const edm::EventSetup& environment) {}

void MuGEML1FETableProducer::fillTable(edm::Event& ev) {
std::vector<int> bxDiffs;

auto record = m_token.conditionalGet(ev);

// in Heavy Ion Physics the getL1aHistoryEntry is not saved ...
// comment out and use this as proxy to inquire BX,Orbit and Lumi
for (const auto l1aEntry : record->getFullL1aHistory()) {
int bxDiff = BX_IN_ORBIT * (record->getOrbitNr() - l1aEntry.getOrbitNr()) + record->getBXID() - l1aEntry.getBXID();
bxDiffs.push_back(bxDiff);
}

auto table = std::make_unique<nanoaod::FlatTable>(bxDiffs.size(), m_name, false, false);
addColumn(table, "bxDiffs", bxDiffs, "BX differences between event and L1As");

ev.put(std::move(table));
}

DEFINE_FWK_MODULE(MuGEML1FETableProducer);
5 changes: 4 additions & 1 deletion DPGAnalysis/MuonTools/python/muNtupleProducerBkg_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

from DPGAnalysis.MuonTools.nano_mu_global_cff import *
from DPGAnalysis.MuonTools.nano_mu_digi_cff import *
from DPGAnalysis.MuonTools.nano_mu_local_reco_cff import *
from DPGAnalysis.MuonTools.nano_mu_reco_cff import *

muDPGNanoProducerBkg = cms.Sequence(globalTables
+ muDigiTablesBkg)
+ muDigiTablesBkg
+ muLocalRecoTablesBkg)

def muDPGNanoBkgCustomize(process) :

Expand Down
9 changes: 7 additions & 2 deletions DPGAnalysis/MuonTools/python/nano_mu_global_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
doc = cms.string("Online luminosity information"),
variables = cms.PSet(
instLumi = Var( "instLumi()", "double", doc = "Instantaneous luminosity"),
avgPileUp = Var( "avgPileUp()", "double", doc = "Average PU")
avgPileUp = Var( "avgPileUp()", "double", doc = "Average PU"),
timestamp = Var( "timestamp().unixTime()", "uint", doc = "Time Stamp")
)
)

globalTables = cms.Sequence(lumiTable + lhcInfoTable)
from DPGAnalysis.MuonTools.muGEML1FETableProducer_cfi import muGEML1FETableProducer

muGEML1FETable = muGEML1FETableProducer.clone()

globalTables = cms.Sequence(lumiTable + lhcInfoTable + muGEML1FETable)
5 changes: 5 additions & 0 deletions DPGAnalysis/MuonTools/python/nano_mu_local_reco_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,8 @@
+ muDTSegmentExtTable
+ gemSegmentFlatTable
)

muLocalRecoTablesBkg = cms.Sequence(rpcRecHitFlatTable
+ gemRecHitFlatTable
+ dtSegmentFlatTable
)
1 change: 1 addition & 0 deletions PhysicsTools/NanoAOD/plugins/LHCInfoProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class LHCInfoProducer : public edm::global::EDProducer<edm::BeginLuminosityBlock
out->addFloat("crossingAngle", "LHC crossing angle", lhcInfoCombined.crossingAngle());
out->addFloat("betaStar", "LHC beta star", lhcInfoCombined.betaStarX);
out->addFloat("energy", "LHC beam energy", lhcInfoCombined.energy);
out->addInt("fill", "LHC fill number", lhcInfoCombined.fillNumber);
iLumi.put(std::move(out));
}

Expand Down