CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends
DTLocalTriggerTask Class Reference

#include <DTLocalTriggerTask.h>

Inheritance diagram for DTLocalTriggerTask:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTLocalTriggerTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 To reset the MEs. More...
 
void bookBarrelHistos (DQMStore::IBooker &, std::string histoTag)
 Book the histograms. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 Book the histograms. More...
 
void bookHistos (DQMStore::IBooker &, const DTChamberId &dtCh, std::string folder, std::string histoTag)
 
void bookWheelHistos (DQMStore::IBooker &, int wh, std::string histoTag)
 Book the histograms. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 Beginrun. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) final
 
void runSegmentAnalysis (edm::Handle< DTRecSegment4DCollection > &segments4D)
 Run analysis using DT 4D segments. More...
 
void runTMAnalysis (std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
 Run analysis on TM data. More...
 
void setQLabels (MonitorElement *me, short int iaxis)
 Set Quality labels. More...
 
void setQLabelsTheta (MonitorElement *me, short int iaxis)
 
std::string & topFolder ()
 Get the Top folder (different between Physics and TP and TM) More...
 
void triggerSource (const edm::Event &e)
 Get the L1A source. More...
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Protected Attributes

const int wheelArrayShift = 3
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Attributes

std::string baseFolderTM
 
bool detailedAnalysis
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
 
bool doTMTheta
 
DTArr3PhDigi iphbest
 
bool isLocalRun
 
DTArr3ThDigi ithbest
 
edm::EDGetTokenT< LTCDigiCollectionltcDigiCollectionToken_
 
DTArr3mapInt mapDTTF
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nevents
 
edm::ParameterSet parameters
 
DTArr3int phcode_best
 
edm::EDGetTokenT< DTLocalTriggerCollectionros_Token_
 
edm::EDGetTokenT< DTRecSegment4DCollectionseg_Token_
 
DTArr3int thcode_best
 
MonitorElementtm_IDDataErrorPlot
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_Token_
 
edm::EDGetTokenT< L1MuDTChambThContainertmTh_Token_
 
bool tpMode
 
bool track_ok [6][5][15]
 
DTTrigGeomUtilstrigGeomUtils
 
std::string trigsrc
 
bool useSEG
 
bool useTM
 
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
 

Friends

class DTMonitorModule
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 50 of file DTLocalTriggerTask.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerTask()

DTLocalTriggerTask::DTLocalTriggerTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file DTLocalTriggerTask.cc.

References baseFolderTM, detailedAnalysis, doTMTheta, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_2022v12_cff::InputTag, isLocalRun, LogTrace, ltcDigiCollectionToken_, parameters, ros_Token_, seg_Token_, tm_Token_, tmTh_Token_, and tpMode.

34  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()),
35  trigGeomUtils(nullptr),
36  isLocalRun(ps.getUntrackedParameter<bool>("localrun", true)) {
37  if (!isLocalRun) {
38  ltcDigiCollectionToken_ = consumes<LTCDigiCollection>(ps.getParameter<edm::InputTag>("ltcDigiCollectionTag"));
39  }
40 
41  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Constructor" << endl;
42 
43  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
44  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis", false);
45  doTMTheta = ps.getUntrackedParameter<bool>("enableTMTheta", false);
46  tm_Token_ = consumes<L1MuDTChambPhContainer>(
47  ps.getUntrackedParameter<InputTag>("tm_label", InputTag("twinMuxStage2Digis:PhIn")));
48  tmTh_Token_ = consumes<L1MuDTChambThContainer>(
49  ps.getUntrackedParameter<edm::InputTag>("tmTh_label", InputTag("twinMuxStage2Digis:ThIn")));
50 
51  ros_Token_ =
52  consumes<DTLocalTriggerCollection>(ps.getUntrackedParameter<InputTag>("ros_label", InputTag("dtunpacker")));
53  seg_Token_ =
54  consumes<DTRecSegment4DCollection>(ps.getUntrackedParameter<InputTag>("seg_label", InputTag("dt4DSegments")));
55 
56  if (tpMode) {
57  baseFolderTM = "DT/11-LocalTriggerTP-TM/";
58  } else {
59  baseFolderTM = "DT/03-LocalTrigger-TM/";
60  }
61 
62  parameters = ps;
63 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
edm::EDGetTokenT< L1MuDTChambThContainer > tmTh_Token_
edm::EDGetTokenT< DTLocalTriggerCollection > ros_Token_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
edm::ParameterSet parameters
DTTrigGeomUtils * trigGeomUtils

◆ ~DTLocalTriggerTask()

DTLocalTriggerTask::~DTLocalTriggerTask ( )
override

Destructor.

Definition at line 65 of file DTLocalTriggerTask.cc.

References LogTrace, nevents, and trigGeomUtils.

65  {
66  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask")
67  << "[DTLocalTriggerTask]: analyzed " << nevents << " events" << endl;
68  if (trigGeomUtils) {
69  delete trigGeomUtils;
70  }
71 }
#define LogTrace(id)
DTTrigGeomUtils * trigGeomUtils

Member Function Documentation

◆ analyze()

void DTLocalTriggerTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 195 of file DTLocalTriggerTask.cc.

References MillePedeFileConverter_cfg::e, L1MuDTChambPhContainer::getContainer(), L1MuDTChambThContainer::getContainer(), edm::ParameterSet::getUntrackedParameter(), edm::HandleBase::isValid(), nevents, parameters, runSegmentAnalysis(), runTMAnalysis(), seg_Token_, tm_Token_, tmTh_Token_, tpMode, triggerSource(), useSEG, and useTM.

195  {
196  if (!nevents) {
198  e.getByToken(tm_Token_, l1DTTPGPh);
200  e.getByToken(tmTh_Token_, l1DTTPGTh);
201 
202  useTM = (l1DTTPGPh.isValid() || l1DTTPGTh.isValid()) && parameters.getUntrackedParameter<bool>("process_tm", true);
203 
204  Handle<DTRecSegment4DCollection> all4DSegments;
205  e.getByToken(seg_Token_, all4DSegments);
206  useSEG = all4DSegments.isValid() && parameters.getUntrackedParameter<bool>("process_seg", true);
207  }
208 
209  nevents++;
210 
211  triggerSource(e);
212 
213  if (useTM) {
215  e.getByToken(tm_Token_, l1DTTPGPh);
216  vector<L1MuDTChambPhDigi> const* l1PhTrig = l1DTTPGPh->getContainer();
217 
219  e.getByToken(tmTh_Token_, l1DTTPGTh);
220 
221  vector<L1MuDTChambThDigi> const* l1ThTrig = l1DTTPGTh->getContainer();
222 
223  runTMAnalysis(l1PhTrig, l1ThTrig);
224  }
225  if (!tpMode && useSEG) {
227  e.getByToken(seg_Token_, segments4D);
228 
229  runSegmentAnalysis(segments4D);
230  }
231 }
void runTMAnalysis(std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
Run analysis on TM data.
void runSegmentAnalysis(edm::Handle< DTRecSegment4DCollection > &segments4D)
Run analysis using DT 4D segments.
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
edm::EDGetTokenT< L1MuDTChambThContainer > tmTh_Token_
Phi_Container const * getContainer() const
bool isValid() const
Definition: HandleBase.h:70
edm::ParameterSet parameters
void triggerSource(const edm::Event &e)
Get the L1A source.

◆ beginLuminosityBlock()

void DTLocalTriggerTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

Definition at line 180 of file DTLocalTriggerTask.cc.

References digiHistos, edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), genParticles_cff::map, and parameters.

180  {
181  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Begin of LS transition" << endl;
182 
183  if (lumiSeg.id().luminosityBlock() % parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
184  for (map<uint32_t, map<string, MonitorElement*> >::const_iterator histo = digiHistos.begin();
185  histo != digiHistos.end();
186  histo++) {
187  for (map<string, MonitorElement*>::const_iterator ht = (*histo).second.begin(); ht != (*histo).second.end();
188  ht++) {
189  (*ht).second->Reset();
190  }
191  }
192  }
193 }
LuminosityBlockNumber_t luminosityBlock() const
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
LuminosityBlockID id() const
edm::ParameterSet parameters
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos

◆ bookBarrelHistos()

void DTLocalTriggerTask::bookBarrelHistos ( DQMStore::IBooker ,
std::string  histoTag 
)
protected

Book the histograms.

Definition at line 233 of file DTLocalTriggerTask.cc.

References dqm::implementation::IBooker::book1D(), dtResolutionTest_cfi::histoTag, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), tm_IDDataErrorPlot, and topFolder().

Referenced by bookHistograms().

233  {
234  ibooker.setCurrentFolder(topFolder());
235  if (histoTag == "TM_ErrorsChamberID") {
236  tm_IDDataErrorPlot = ibooker.book1D(histoTag.c_str(), "TM Data ID Error", 5, -2, 3);
237  tm_IDDataErrorPlot->setAxisTitle("wheel", 1);
238  }
239 
240  return;
241 }
MonitorElement * tm_IDDataErrorPlot
std::string & topFolder()
Get the Top folder (different between Physics and TP and TM)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ bookHistograms()

void DTLocalTriggerTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Book the histograms.

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 79 of file DTLocalTriggerTask.cc.

References bookBarrelHistos(), bookHistos(), detailedAnalysis, doTMTheta, edm::ParameterSet::getUntrackedParameter(), LogTrace, parameters, edm_modernize_messagelogger::stat, and tpMode.

81  {
82  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: bookHistograms" << endl;
83 
84  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) { // Static histo booking
85 
86  vector<string> trigSources;
87  if (parameters.getUntrackedParameter<bool>("localrun", true)) {
88  trigSources.push_back("");
89  } else {
90  trigSources.push_back("_DTonly");
91  trigSources.push_back("_NoDT");
92  trigSources.push_back("_DTalso");
93  }
94  vector<string>::const_iterator trigSrcIt = trigSources.begin();
95  vector<string>::const_iterator trigSrcEnd = trigSources.end();
96 
97  if (parameters.getUntrackedParameter<bool>("process_tm", true)) {
98  bookBarrelHistos(ibooker, "TM_ErrorsChamberID");
99  }
100 
101  if (tpMode) {
102  for (int stat = 1; stat < 5; ++stat) {
103  for (int wh = -2; wh < 3; ++wh) {
104  for (int sect = 1; sect < 13; ++sect) {
105  DTChamberId dtChId(wh, stat, sect);
106 
107  if (parameters.getUntrackedParameter<bool>("process_tm", true)) { // TM data
108  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_BXvsQual" + (*trigSrcIt));
109  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_QualvsPhirad" + (*trigSrcIt));
110  }
111  }
112  }
113  } // end of loop
114  } else {
115  for (; trigSrcIt != trigSrcEnd; ++trigSrcIt) {
116  for (int wh = -2; wh < 3; ++wh) {
117  for (int sect = 1; sect < 13; ++sect) {
118  for (int stat = 1; stat < 5; ++stat) {
119  DTChamberId dtChId(wh, stat, sect);
120  if (parameters.getUntrackedParameter<bool>("process_tm", true)) { // TM data
121 
122  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_BXvsQual_In" + (*trigSrcIt));
123  if (detailedAnalysis) {
124  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_QualvsPhirad_In" + (*trigSrcIt));
125  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_QualvsPhibend_In" + (*trigSrcIt));
126  }
127  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_Flag1stvsQual_In" + (*trigSrcIt));
128  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_FlagUpDownvsQual_In" + (*trigSrcIt));
129 
130  bookHistos(ibooker, dtChId, "LocalTriggerPhiIn", "TM_BestQual_In" + (*trigSrcIt));
131  if (stat != 4 && doTMTheta) {
132  bookHistos(ibooker, dtChId, "LocalTriggerTheta", "TM_PositionvsBX" + (*trigSrcIt));
133  bookHistos(ibooker, dtChId, "LocalTriggerTheta", "TM_QualityvsBX" + (*trigSrcIt));
134 
135  bookHistos(ibooker, dtChId, "LocalTriggerTheta", "TM_PositionvsQual" + (*trigSrcIt));
136 
137  bookHistos(ibooker, dtChId, "LocalTriggerTheta", "TM_ThetaBXvsQual" + (*trigSrcIt));
138  bookHistos(ibooker, dtChId, "LocalTriggerTheta", "TM_ThetaBestQual" + (*trigSrcIt));
139  }
140 
141  if (parameters.getUntrackedParameter<bool>("process_seg", true)) { // TM + Segemnt
142  bookHistos(ibooker, dtChId, "Segment", "TM_PhitkvsPhitrig" + (*trigSrcIt));
143  bookHistos(ibooker, dtChId, "Segment", "TM_PhibtkvsPhibtrig" + (*trigSrcIt));
144  bookHistos(ibooker, dtChId, "Segment", "TM_PhiResidual" + (*trigSrcIt));
145  bookHistos(ibooker, dtChId, "Segment", "TM_PhiResidualvsLUTPhi" + (*trigSrcIt));
146  bookHistos(ibooker, dtChId, "Segment", "TM_PhibResidual" + (*trigSrcIt));
147  bookHistos(ibooker, dtChId, "Segment", "TM_HitstkvsQualtrig" + (*trigSrcIt));
148  bookHistos(ibooker, dtChId, "Segment", "TM_TrackPosvsAngle" + (*trigSrcIt));
149  bookHistos(ibooker, dtChId, "Segment", "TM_TrackPosvsAngleandTrig" + (*trigSrcIt));
150  bookHistos(ibooker, dtChId, "Segment", "TM_TrackPosvsAngleandTrigHHHL" + (*trigSrcIt));
151  if (stat != 4) {
152  bookHistos(ibooker, dtChId, "Segment", "TM_TrackThetaPosvsAngle" + (*trigSrcIt)); // theta view
153  bookHistos(ibooker, dtChId, "Segment", "TM_TrackThetaPosvsAngleandTrig" + (*trigSrcIt));
154  bookHistos(ibooker,
155  dtChId,
156  "Segment",
157  "TM_TrackThetaPosvsAngleandTrigH" + (*trigSrcIt)); // TM theta quality not available!
158  }
159  }
160  }
161  }
162  }
163  for (int sect = 13; sect < 15; ++sect) {
164  DTChamberId dtChId(wh, 4, sect);
165  if (parameters.getUntrackedParameter<bool>("process_tm", true) &&
166  parameters.getUntrackedParameter<bool>("process_seg", true)) { // TM+SEG LUTs data
167  bookHistos(ibooker, dtChId, "Segment", "TM_PhitkvsPhitrig" + (*trigSrcIt));
168  bookHistos(ibooker, dtChId, "Segment", "TM_PhibtkvsPhibtrig" + (*trigSrcIt));
169  bookHistos(ibooker, dtChId, "Segment", "TM_PhiResidual" + (*trigSrcIt));
170  bookHistos(ibooker, dtChId, "Segment", "TM_PhiResidualvsLUTPhi" + (*trigSrcIt));
171  bookHistos(ibooker, dtChId, "Segment", "TM_PhibResidual" + (*trigSrcIt));
172  }
173  }
174  }
175  } // end of loop
176  }
177  }
178 }
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
void bookHistos(DQMStore::IBooker &, const DTChamberId &dtCh, std::string folder, std::string histoTag)
edm::ParameterSet parameters
void bookBarrelHistos(DQMStore::IBooker &, std::string histoTag)
Book the histograms.

◆ bookHistos()

void DTLocalTriggerTask::bookHistos ( DQMStore::IBooker ,
const DTChamberId dtCh,
std::string  folder,
std::string  histoTag 
)
protected

Definition at line 243 of file DTLocalTriggerTask.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), digiHistos, printsummarytable::folder, edm::ParameterSet::getUntrackedParameter(), fftjetimagerecorder_cfi::histoLabel, HltBtagPostValidation_cff::histoName, dtResolutionTest_cfi::histoTag, createfilelist::int, LogTrace, SiStripPI::max, hltL1TEGammaFilteredCollectionProducer_cfi::maxBX, SiStripPI::min, hltL1TEGammaFilteredCollectionProducer_cfi::minBX, LaserClient_cfi::nbins, parameters, DTTrigGeomUtils::phiRange(), DetId::rawId(), DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), setQLabels(), setQLabelsTheta(), DTChamberId::station(), relativeConstraints::station, DTTrigGeomUtils::thetaRange(), topFolder(), trigGeomUtils, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

246  {
247  int wh = dtCh.wheel();
248  int sc = dtCh.sector();
249  stringstream wheel;
250  wheel << wh;
251  stringstream station;
252  station << dtCh.station();
253  stringstream sector;
254  sector << sc;
255 
256  double minBX = 0;
257  double maxBX = 0;
258  int rangeBX = 0;
259 
260  string histoType = histoTag.substr(3, histoTag.find('_', 3) - 3);
261 
262  ibooker.setCurrentFolder(topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() +
263  "/" + folder);
264 
265  string histoName = histoTag + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
266 
267  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask")
268  << "[DTLocalTriggerTask]: booking " << topFolder() << "Wheel" << wheel.str() << "/Sector" << sector.str()
269  << "/Station" << station.str() << "/" << folder << "/" << histoName << endl;
270 
271  if (histoType.find("BX") != string::npos) {
272  if (histoTag.substr(0, 2) == "TM") {
273  minBX = parameters.getUntrackedParameter<int>("minBXTM", -2) - 0.5;
274  maxBX = parameters.getUntrackedParameter<int>("maxBXTM", 2) + 0.5;
275  }
276  rangeBX = (int)(maxBX - minBX);
277  }
278 
279  if (folder == "LocalTriggerPhiIn") {
280  if (histoType == "BXvsQual") {
281  (digiHistos[dtCh.rawId()])[histoTag] =
282  ibooker.book2D(histoName, "BX vs trigger quality", 7, -0.5, 6.5, rangeBX, minBX, maxBX);
283  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 1);
284  return;
285  }
286  if (histoType == "BestQual") {
287  (digiHistos[dtCh.rawId()])[histoTag] =
288  ibooker.book1D(histoName, "Trigger quality of best primitives", 7, -0.5, 6.5);
289  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 1);
290  return;
291  }
292  if (histoType == "QualvsPhirad") {
293  (digiHistos[dtCh.rawId()])[histoTag] =
294  ibooker.book2D(histoName, "Trigger quality vs local position", 100, -500., 500., 7, -0.5, 6.5);
295  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 2);
296  return;
297  }
298  if (histoType == "QualvsPhibend") {
299  (digiHistos[dtCh.rawId()])[histoTag] =
300  ibooker.book2D(histoName, "Trigger quality vs local direction", 200, -40., 40., 7, -0.5, 6.5);
301  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 2);
302  return;
303  }
304  if (histoType == "Flag1stvsQual") {
305  (digiHistos[dtCh.rawId()])[histoTag] =
306  ibooker.book2D(histoName, "1st/2nd trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
307  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 1);
308  return;
309  }
310  if (histoType == "FlagUpDownvsQual") {
311  (digiHistos[dtCh.rawId()])[histoTag] =
312  ibooker.book2D(histoName, "Up/Down trig flag vs quality", 7, -0.5, 6.5, 2, -0.5, 1.5);
313  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 1);
314  return;
315  }
316 
317  } else if (folder == "LocalTriggerTheta") {
318  if (histoType == "PositionvsBX") {
319  (digiHistos[dtCh.rawId()])[histoTag] =
320  ibooker.book2D(histoName, "Theta trigger position vs BX", rangeBX, minBX, maxBX, 7, -0.5, 6.5);
321  return;
322  }
323  if (histoType == "PositionvsQual") {
324  (digiHistos[dtCh.rawId()])[histoTag] =
325  ibooker.book2D(histoName, "Theta trigger position vs quality", 2, 0.5, 2.5, 7, -0.5, 6.5);
326  setQLabelsTheta((digiHistos[dtCh.rawId()])[histoTag], 1);
327  return;
328  }
329  if (histoType == "ThetaBXvsQual") {
330  (digiHistos[dtCh.rawId()])[histoTag] =
331  ibooker.book2D(histoName, "BX vs trigger quality", 2, 0.5, 2.5, rangeBX, minBX, maxBX);
332  setQLabelsTheta((digiHistos[dtCh.rawId()])[histoTag], 1);
333  }
334  if (histoType == "ThetaBestQual") { //It does not make sense: 7 positions, how to define best?
335  (digiHistos[dtCh.rawId()])[histoTag] = ibooker.book1D(
336  histoName, "Trigger quality of best primitives (theta)", 2, 0.5, 2.5); // 0 = not fired, 1 = L, 2 = H
337  setQLabelsTheta((digiHistos[dtCh.rawId()])[histoTag], 1);
338  return;
339  }
340 
341  } else if (folder == "Segment") {
342  if (histoType.find("TrackThetaPosvsAngle") == 0) {
343  string histoLabel = "Position vs Angle (theta)";
344  if (histoType.find("andTrigH") != string::npos)
345  histoLabel += " for H triggers";
346  else if (histoType.find("andTrig") != string::npos)
347  histoLabel += " for triggers";
348 
349  float min, max;
350  int nbins;
352  (digiHistos[dtCh.rawId()])[histoTag] = ibooker.book2D(histoName, histoLabel, 16, -40., 40., nbins, min, max);
353  return;
354  }
355  if (histoType.find("TrackPosvsAngle") == 0) {
356  float min, max;
357  int nbins;
358  trigGeomUtils->phiRange(dtCh, min, max, nbins);
359 
360  string histoLabel = "Position vs Angle (phi)";
361  if (histoType.find("andTrigHHHL") != string::npos)
362  histoLabel += " for HH/HL triggers";
363  else if (histoType.find("andTrig") != string::npos)
364  histoLabel += " for triggers";
365 
366  (digiHistos[dtCh.rawId()])[histoTag] = ibooker.book2D(histoName, histoLabel, 16, -40., 40., nbins, min, max);
367  return;
368  }
369  if (histoType == "PhitkvsPhitrig") {
370  (digiHistos[dtCh.rawId()])[histoTag] =
371  ibooker.book2D(histoName, "Local position: segment vs trigger", 100, -500., 500., 100, -500., 500.);
372  return;
373  }
374  if (histoType == "PhibtkvsPhibtrig") {
375  (digiHistos[dtCh.rawId()])[histoTag] =
376  ibooker.book2D(histoName, "Local direction : segment vs trigger", 200, -40., 40., 200, -40., 40.);
377  return;
378  }
379  if (histoType == "PhiResidual") {
380  (digiHistos[dtCh.rawId()])[histoTag] = ibooker.book1D(
381  histoName, "Trigger local position - Segment local position (correlated triggers)", 400, -10., 10.);
382  return;
383  }
384  if (histoType == "PhibResidual") {
385  (digiHistos[dtCh.rawId()])[histoTag] = ibooker.book1D(
386  histoName, "Trigger local direction - Segment local direction (correlated triggers)", 500, -10., 10.);
387  return;
388  }
389  if (histoType == "HitstkvsQualtrig") {
390  (digiHistos[dtCh.rawId()])[histoTag] =
391  ibooker.book2D(histoName, "Segment hits (phi) vs trigger quality", 7, -0.5, 6.5, 10, 0.5, 10.5);
392  setQLabels((digiHistos[dtCh.rawId()])[histoTag], 1);
393  return;
394  }
395  }
396 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
void setQLabelsTheta(MonitorElement *me, short int iaxis)
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void setQLabels(MonitorElement *me, short int iaxis)
Set Quality labels.
edm::ParameterSet parameters
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
DTTrigGeomUtils * trigGeomUtils
std::string & topFolder()
Get the Top folder (different between Physics and TP and TM)
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos

◆ bookWheelHistos()

void DTLocalTriggerTask::bookWheelHistos ( DQMStore::IBooker ,
int  wh,
std::string  histoTag 
)
protected

Book the histograms.

Definition at line 398 of file DTLocalTriggerTask.cc.

References HltBtagPostValidation_cff::histoName, dtResolutionTest_cfi::histoTag, LogTrace, dqm::implementation::NavigatorBase::setCurrentFolder(), topFolder(), and makeMuonMisalignmentScenario::wheel.

398  {
399  stringstream wheel;
400  wheel << wh;
401 
402  string histoType = histoTag.substr(3, histoTag.find('_', 3) - 3);
403 
404  ibooker.setCurrentFolder(topFolder() + "Wheel" + wheel.str() + "/");
405 
406  string histoName = histoTag + "_W" + wheel.str();
407 
408  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask")
409  << "[DTLocalTriggerTask]: booking " << topFolder() << "Wheel" << wheel.str() << "/" << histoName << endl;
410 }
#define LogTrace(id)
std::string & topFolder()
Get the Top folder (different between Physics and TP and TM)

◆ dqmBeginRun()

void DTLocalTriggerTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotectedvirtual

Beginrun.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 73 of file DTLocalTriggerTask.cc.

References visDQMUpload::context, muonGeom, muonGeomToken_, nevents, and trigGeomUtils.

73  {
74  nevents = 0;
75  muonGeom = &context.getData(muonGeomToken_);
77 }
const DTGeometry * muonGeom
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
DTTrigGeomUtils * trigGeomUtils

◆ endLuminosityBlock()

void DTLocalTriggerTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
inlinefinalprotected

Definition at line 90 of file DTLocalTriggerTask.h.

90 {}

◆ runSegmentAnalysis()

void DTLocalTriggerTask::runSegmentAnalysis ( edm::Handle< DTRecSegment4DCollection > &  segments4D)
protected

Run analysis using DT 4D segments.

Definition at line 540 of file DTLocalTriggerTask.cc.

References DTTrigGeomUtils::computeSCCoordinates(), digiHistos, iphbest, phcode_best, FastTimerService_cff::range, DetId::rawId(), relativeConstraints::station, thcode_best, HLT_2022v12_cff::track, track_ok, DTTrigGeomUtils::trigDir(), trigGeomUtils, DTTrigGeomUtils::trigPos(), trigsrc, DTTrigGeomUtils::trigToSeg(), useTM, and makeMuonMisalignmentScenario::wheel.

Referenced by analyze().

540  {
542 
543  // Find best tracks & good tracks
544  memset(track_ok, false, 450 * sizeof(bool));
545 
547  vector<const DTRecSegment4D*> best4DSegments;
548 
549  // Preliminary loop finds best 4D Segment and high quality ones
550  for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId) {
551  DTRecSegment4DCollection::range range = segments4D->get(*chamberId);
552  const DTRecSegment4D* tmpBest = nullptr;
553  int tmpdof = 0;
554  int dof = 0;
555 
556  for (track = range.first; track != range.second; ++track) {
557  if ((*track).hasPhi()) {
558  dof = (*track).phiSegment()->degreesOfFreedom();
559  if (dof > tmpdof) {
560  tmpBest = &(*track);
561  tmpdof = dof;
562 
563  int wheel = (*track).chamberId().wheel();
564  int sector = (*track).chamberId().sector();
565  int station = (*track).chamberId().station();
566  if (sector == 13) {
567  sector = 4;
568  } else if (sector == 14) {
569  sector = 10;
570  }
571  track_ok[wheel + 3][station][sector] = (!track_ok[wheel + 3][station][sector] && dof >= 2);
572  }
573  }
574  }
575  if (tmpBest)
576  best4DSegments.push_back(tmpBest);
577  }
578 
579  vector<const DTRecSegment4D*>::const_iterator btrack;
580 
581  for (btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack) {
582  if ((*btrack)->hasPhi()) { // Phi component
583 
584  int wheel = (*btrack)->chamberId().wheel();
585  int station = (*btrack)->chamberId().station();
586  int sector = (*btrack)->chamberId().sector();
587  int scsector = 0;
588  float x_track, y_track, x_angle, y_angle;
589  trigGeomUtils->computeSCCoordinates((*btrack), scsector, x_track, x_angle, y_track, y_angle);
590  int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom() + 2;
591 
592  DTChamberId dtChId(wheel, station, sector); // get chamber for LUTs histograms (Sectors 1 to 14)
593  uint32_t indexCh = dtChId.rawId();
594  map<string, MonitorElement*>& innerMECh = digiHistos[indexCh];
595 
596  DTChamberId dtChIdSC =
597  DTChamberId(wheel, station, scsector); // get chamber for histograms SC granularity (sectors 1 to 12)
598  indexCh = dtChIdSC.rawId();
599  map<string, MonitorElement*>& innerME = digiHistos[indexCh];
600 
601  if (useTM && phcode_best[wheel + 3][station][scsector] > -1 && phcode_best[wheel + 3][station][scsector] < 7) {
602  innerME.find("TM_HitstkvsQualtrig" + trigsrc)->second->Fill(phcode_best[wheel + 3][station][scsector], nHitsPhi);
603 
604  if (phcode_best[wheel + 3][station][scsector] > 3 && nHitsPhi >= 7) {
605  float x_trigger = trigGeomUtils->trigPos(iphbest[wheel + 3][station][scsector]);
606  float angle_trigger = trigGeomUtils->trigDir(iphbest[wheel + 3][station][scsector]);
607  trigGeomUtils->trigToSeg(station, x_trigger, x_angle);
608 
609  innerMECh.find("TM_PhitkvsPhitrig" + trigsrc)->second->Fill(x_trigger, x_track);
610  innerMECh.find("TM_PhibtkvsPhibtrig" + trigsrc)->second->Fill(angle_trigger, x_angle);
611  innerMECh.find("TM_PhiResidual" + trigsrc)->second->Fill(x_trigger - x_track);
612  innerMECh.find("TM_PhibResidual" + trigsrc)->second->Fill(angle_trigger - x_angle);
613  }
614  }
615 
616  if (useTM) {
617  // check for triggers elsewhere in the sector
618  bool trigFlagTM = false;
619  for (int ist = 1; ist < 5; ist++) {
620  if (ist != station && phcode_best[wheel + 3][ist][scsector] >= 2 &&
621  phcode_best[wheel + 3][ist][scsector] < 7 && track_ok[wheel + 3][ist][scsector] == true) {
622  trigFlagTM = true;
623  break;
624  }
625  }
626 
627  if (trigFlagTM && fabs(x_angle) < 40. && nHitsPhi >= 7) {
628  // position vs angle of track for reconstruced tracks (denom. for trigger efficiency)
629  innerME.find("TM_TrackPosvsAngle" + trigsrc)->second->Fill(x_angle, x_track);
630  if (phcode_best[wheel + 3][station][scsector] >= 2 && phcode_best[wheel + 3][station][scsector] < 7) {
631  innerME.find("TM_TrackPosvsAngleandTrig" + trigsrc)->second->Fill(x_angle, x_track);
632  if (phcode_best[wheel + 3][station][scsector] > 4) { //HH & HL Triggers
633  innerME.find("TM_TrackPosvsAngleandTrigHHHL" + trigsrc)->second->Fill(x_angle, x_track);
634  }
635  }
636  }
637 
638  if ((*btrack)->hasZed() && trigFlagTM && fabs(y_angle) < 40. &&
639  (*btrack)->zSegment()->degreesOfFreedom() >= 1) {
640  // position va angle of track for reconstruced tracks (denom. for trigger efficiency) along theta direction
641  innerME.find("TM_TrackThetaPosvsAngle" + trigsrc)->second->Fill(y_angle, y_track);
642  if (thcode_best[wheel + 3][station][scsector] > 0) {
643  innerME.find("TM_TrackThetaPosvsAngleandTrig" + trigsrc)->second->Fill(y_angle, y_track);
644  if (thcode_best[wheel + 3][station][scsector] == 2) {
645  innerME.find("TM_TrackThetaPosvsAngleandTrigH" + trigsrc)->second->Fill(y_angle, y_track);
646  }
647  }
648  }
649  }
650  }
651  }
652 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
identifier iterator
Definition: RangeMap.h:130
bool track_ok[6][5][15]
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTTrigGeomUtils * trigGeomUtils
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.

◆ runTMAnalysis()

void DTLocalTriggerTask::runTMAnalysis ( std::vector< L1MuDTChambPhDigi > const *  phTrigs,
std::vector< L1MuDTChambThDigi > const *  thTrigs 
)
protected

Run analysis on TM data.

Definition at line 412 of file DTLocalTriggerTask.cc.

References angle(), detailedAnalysis, digiHistos, doTMTheta, dqm::impl::MonitorElement::Fill(), dtResolutionTest_cfi::histoTag, mps_fire::i, triggerObjects_cff::id, iphbest, ithbest, dqmiolumiharvest::j, dqmdumpme::k, phcode_best, DetId::rawId(), thcode_best, tm_IDDataErrorPlot, tpMode, DTTrigGeomUtils::trigDir(), trigGeomUtils, DTTrigGeomUtils::trigPos(), trigsrc, wheelArrayShift, and x.

Referenced by analyze().

413  {
414  //exit(0);
415 
416  string histoType;
417  string histoTag;
418 
419  // define best quality trigger segment (phi and theta)
420  // in any station start from 1 and zero is kept empty
421  for (int i = 0; i < 5; ++i) {
422  for (int j = 0; j < 6; ++j) {
423  for (int k = 0; k < 13; ++k) {
424  phcode_best[j][i][k] = -1;
425  thcode_best[j][i][k] = -1;
426  }
427  }
428  }
429 
430  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
431  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
432  for (; iph != iphe; ++iph) {
433  int phwheel = iph->whNum();
434  int phsec = iph->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
435  int phst = iph->stNum();
436  int phbx = iph->bxNum();
437  int phcode = iph->code();
438  int phi1st = iph->Ts2Tag();
439  int updown = iph->UpDownTag();
440 
441  // FIXME: workaround for TM data with station ID
442  if (phst == 0) {
443  tm_IDDataErrorPlot->Fill(phwheel);
444  continue;
445  }
446 
447  if (phcode > phcode_best[phwheel + 3][phst][phsec] && phcode < 7) {
448  phcode_best[phwheel + 3][phst][phsec] = phcode;
449  iphbest[phwheel + 3][phst][phsec] = &(*iph);
450  }
451 
452  DTChamberId dtChId(phwheel, phst, phsec);
453 
454  float x = trigGeomUtils->trigPos(&(*iph));
455  float angle = trigGeomUtils->trigDir(&(*iph));
456  uint32_t indexCh = dtChId.rawId();
457 
458  map<string, MonitorElement*>& innerME = digiHistos[indexCh];
459 
460  if (tpMode) {
461  innerME.find("TM_BXvsQual" + trigsrc)->second->Fill(phcode, phbx - phi1st); // SM BX vs Qual Phi view (1st tracks)
462  innerME.find("TM_QualvsPhirad" + trigsrc)->second->Fill(x, phcode); // SM Qual vs radial angle Phi view
463  } else {
464  innerME.find("TM_BXvsQual_In" + trigsrc)
465  ->second->Fill(phcode, phbx - phi1st); // SM BX vs Qual Phi view (1st tracks)
466  innerME.find("TM_Flag1stvsQual_In" + trigsrc)
467  ->second->Fill(phcode, phi1st); // SM Qual 1st/2nd track flag Phi view
468  innerME.find("TM_FlagUpDownvsQual_In" + trigsrc)
469  ->second->Fill(phcode, updown); // SM Qual Up/Down track flag Phi view
470  if (detailedAnalysis) {
471  innerME.find("TM_QualvsPhirad_In" + trigsrc)->second->Fill(x, phcode); // SM Qual vs radial angle Phi view
472  innerME.find("TM_QualvsPhibend_In" + trigsrc)->second->Fill(angle, phcode); // SM Qual vs bending Phi view
473  }
474  }
475  }
476 
477  if (doTMTheta) {
478  int thcode[7];
479  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
480  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
481  for (; ith != ithe; ++ith) {
482  int thwheel = ith->whNum();
483  int thsec = ith->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
484  int thst = ith->stNum();
485  int thbx = ith->bxNum();
486 
487  for (int pos = 0; pos < 7; pos++) {
488  thcode[pos] = ith->code(pos);
489 
490  if (thcode[pos] > thcode_best[thwheel + 3][thst][thsec]) {
491  thcode_best[thwheel + 3][thst][thsec] = thcode[pos];
492  ithbest[thwheel + 3][thst][thsec] = &(*ith);
493  }
494  }
495 
496  DTChamberId dtChId(thwheel, thst, thsec);
497  uint32_t indexCh = dtChId.rawId();
498 
499  map<string, MonitorElement*>& innerME = digiHistos[indexCh];
500 
501  for (int pos = 0; pos < 7; pos++) { //SM fill position for non zero position bit in theta view
502  if (thcode[pos] > 0) { //Fired
503  innerME.find("TM_PositionvsBX" + trigsrc)->second->Fill(thbx, pos); // SM BX vs Position Theta view
504  innerME.find("TM_PositionvsQual" + trigsrc)
505  ->second->Fill(thcode[pos], pos); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
506  innerME.find("TM_ThetaBXvsQual" + trigsrc)
507  ->second->Fill(thcode[pos], thbx); //code = pos + qual; so 0, 1, 2 for 0, L, H resp.
508  }
509  }
510  }
511  }
512 
513  // Fill Quality plots with best TM triggers in phi & theta
514  if (!tpMode) {
515  for (int st = 1; st < 5; ++st) {
516  for (int wh = -2; wh < 3; ++wh) {
517  for (int sc = 1; sc < 13; ++sc) {
518  if (phcode_best[wh + wheelArrayShift][st][sc] > -1 && phcode_best[wh + wheelArrayShift][st][sc] < 7) {
519  DTChamberId id(wh, st, sc);
520  uint32_t indexCh = id.rawId();
521  map<string, MonitorElement*>& innerME = digiHistos[indexCh];
522 
523  innerME.find("TM_BestQual_In" + trigsrc)
524  ->second->Fill(phcode_best[wh + wheelArrayShift][st][sc]); // Best Qual Trigger Phi view
525  }
526  if (thcode_best[wh + wheelArrayShift][st][sc] > 0 && thcode_best[wh + wheelArrayShift][st][sc] < 3) {
527  DTChamberId id(wh, st, sc);
528  uint32_t indexCh = id.rawId();
529  map<string, MonitorElement*>& innerME = digiHistos[indexCh];
530 
531  innerME.find("TM_ThetaBestQual" + trigsrc)
532  ->second->Fill(thcode_best[wh + wheelArrayShift][st][sc]); // Best Qual Trigger Theta view
533  }
534  }
535  }
536  }
537  }
538 }
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
MonitorElement * tm_IDDataErrorPlot
void Fill(long long x)
DTTrigGeomUtils * trigGeomUtils
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ setQLabels()

void DTLocalTriggerTask::setQLabels ( MonitorElement me,
short int  iaxis 
)
protected

Set Quality labels.

Definition at line 654 of file DTLocalTriggerTask.cc.

References timingPdfMaker::histo, mps_fire::i, SummaryClient_cfi::labels, and hlt_dqm_clientPB-live_cfg::me.

Referenced by bookHistos().

654  {
655  TH1* histo = me->getTH1();
656  if (!histo)
657  return;
658 
659  TAxis* axis = nullptr;
660  if (iaxis == 1) {
661  axis = histo->GetXaxis();
662  } else if (iaxis == 2) {
663  axis = histo->GetYaxis();
664  }
665  if (!axis)
666  return;
667 
668  string labels[7] = {"LI", "LO", "HI", "HO", "LL", "HL", "HH"};
669  int istart = axis->GetXmin() < -1 ? 2 : 1;
670  for (int i = 0; i < 7; i++) {
671  axis->SetBinLabel(i + istart, labels[i].c_str());
672  }
673 }

◆ setQLabelsTheta()

void DTLocalTriggerTask::setQLabelsTheta ( MonitorElement me,
short int  iaxis 
)
protected

Definition at line 675 of file DTLocalTriggerTask.cc.

References timingPdfMaker::histo, mps_fire::i, SummaryClient_cfi::labels, and hlt_dqm_clientPB-live_cfg::me.

Referenced by bookHistos().

675  {
676  TH1* histo = me->getTH1();
677  if (!histo)
678  return;
679 
680  TAxis* axis = nullptr;
681  if (iaxis == 1) {
682  axis = histo->GetXaxis();
683  } else if (iaxis == 2) {
684  axis = histo->GetYaxis();
685  }
686  if (!axis)
687  return;
688 
689  string labels[2] = {"L", "H"};
690  int istart = axis->GetXmin() < -1 ? 2 : 1;
691  for (int i = 0; i < 2; i++) {
692  axis->SetBinLabel(i + istart, labels[i].c_str());
693  }
694 }

◆ topFolder()

std::string& DTLocalTriggerTask::topFolder ( )
inlineprotected

Get the Top folder (different between Physics and TP and TM)

Definition at line 96 of file DTLocalTriggerTask.h.

References baseFolderTM.

Referenced by bookBarrelHistos(), bookHistos(), and bookWheelHistos().

96 { return baseFolderTM; }

◆ triggerSource()

void DTLocalTriggerTask::triggerSource ( const edm::Event e)
protected

Get the L1A source.

Definition at line 696 of file DTLocalTriggerTask.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, isLocalRun, ltcDigiCollectionToken_, and trigsrc.

Referenced by analyze().

696  {
697  if (!isLocalRun) {
698  Handle<LTCDigiCollection> ltcdigis;
699  e.getByToken(ltcDigiCollectionToken_, ltcdigis);
700 
701  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++) {
702  size_t otherTriggerSum = 0;
703  for (size_t i = 1; i < 6; i++) {
704  otherTriggerSum += size_t((*ltc_it).HasTriggered(i));
705  }
706  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
707  trigsrc = "_DTonly";
708  else if (!(*ltc_it).HasTriggered(0))
709  trigsrc = "_NoDT";
710  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
711  trigsrc = "_DTalso";
712  }
713  return;
714  }
715 
716  trigsrc = "";
717  return;
718 }
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_

Friends And Related Function Documentation

◆ DTMonitorModule

friend class DTMonitorModule
friend

Definition at line 51 of file DTLocalTriggerTask.h.

Member Data Documentation

◆ baseFolderTM

std::string DTLocalTriggerTask::baseFolderTM
private

Definition at line 111 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and topFolder().

◆ detailedAnalysis

bool DTLocalTriggerTask::detailedAnalysis
private

Definition at line 113 of file DTLocalTriggerTask.h.

Referenced by bookHistograms(), DTLocalTriggerTask(), and runTMAnalysis().

◆ digiHistos

std::map<uint32_t, std::map<std::string, MonitorElement*> > DTLocalTriggerTask::digiHistos
private

◆ doTMTheta

bool DTLocalTriggerTask::doTMTheta
private

Definition at line 112 of file DTLocalTriggerTask.h.

Referenced by bookHistograms(), DTLocalTriggerTask(), and runTMAnalysis().

◆ iphbest

DTArr3PhDigi DTLocalTriggerTask::iphbest
private

Definition at line 118 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis(), and runTMAnalysis().

◆ isLocalRun

bool DTLocalTriggerTask::isLocalRun
private

Definition at line 131 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and triggerSource().

◆ ithbest

DTArr3ThDigi DTLocalTriggerTask::ithbest
private

Definition at line 119 of file DTLocalTriggerTask.h.

Referenced by runTMAnalysis().

◆ ltcDigiCollectionToken_

edm::EDGetTokenT<LTCDigiCollection> DTLocalTriggerTask::ltcDigiCollectionToken_
private

Definition at line 105 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and triggerSource().

◆ mapDTTF

DTArr3mapInt DTLocalTriggerTask::mapDTTF
private

Definition at line 117 of file DTLocalTriggerTask.h.

◆ muonGeom

const DTGeometry* DTLocalTriggerTask::muonGeom
private

Definition at line 124 of file DTLocalTriggerTask.h.

Referenced by dqmBeginRun().

◆ muonGeomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTLocalTriggerTask::muonGeomToken_
private

Definition at line 123 of file DTLocalTriggerTask.h.

Referenced by dqmBeginRun().

◆ nevents

int DTLocalTriggerTask::nevents
private

Definition at line 109 of file DTLocalTriggerTask.h.

Referenced by analyze(), dqmBeginRun(), and ~DTLocalTriggerTask().

◆ parameters

edm::ParameterSet DTLocalTriggerTask::parameters
private

◆ phcode_best

DTArr3int DTLocalTriggerTask::phcode_best
private

Definition at line 115 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis(), and runTMAnalysis().

◆ ros_Token_

edm::EDGetTokenT<DTLocalTriggerCollection> DTLocalTriggerTask::ros_Token_
private

Definition at line 103 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask().

◆ seg_Token_

edm::EDGetTokenT<DTRecSegment4DCollection> DTLocalTriggerTask::seg_Token_
private

Definition at line 104 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

◆ thcode_best

DTArr3int DTLocalTriggerTask::thcode_best
private

Definition at line 116 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis(), and runTMAnalysis().

◆ tm_IDDataErrorPlot

MonitorElement* DTLocalTriggerTask::tm_IDDataErrorPlot
private

Definition at line 129 of file DTLocalTriggerTask.h.

Referenced by bookBarrelHistos(), and runTMAnalysis().

◆ tm_Token_

edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerTask::tm_Token_
private

Definition at line 101 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

◆ tmTh_Token_

edm::EDGetTokenT<L1MuDTChambThContainer> DTLocalTriggerTask::tmTh_Token_
private

Definition at line 102 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

◆ tpMode

bool DTLocalTriggerTask::tpMode
private

Definition at line 110 of file DTLocalTriggerTask.h.

Referenced by analyze(), bookHistograms(), DTLocalTriggerTask(), and runTMAnalysis().

◆ track_ok

bool DTLocalTriggerTask::track_ok[6][5][15]
private

Definition at line 120 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis().

◆ trigGeomUtils

DTTrigGeomUtils* DTLocalTriggerTask::trigGeomUtils
private

◆ trigsrc

std::string DTLocalTriggerTask::trigsrc
private

Definition at line 108 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis(), runTMAnalysis(), and triggerSource().

◆ useSEG

bool DTLocalTriggerTask::useSEG
private

Definition at line 107 of file DTLocalTriggerTask.h.

Referenced by analyze().

◆ useTM

bool DTLocalTriggerTask::useTM
private

Definition at line 107 of file DTLocalTriggerTask.h.

Referenced by analyze(), and runSegmentAnalysis().

◆ wheelArrayShift

const int DTLocalTriggerTask::wheelArrayShift = 3
protected

Definition at line 98 of file DTLocalTriggerTask.h.

Referenced by runTMAnalysis().

◆ wheelHistos

std::map<int, std::map<std::string, MonitorElement*> > DTLocalTriggerTask::wheelHistos
private

Definition at line 127 of file DTLocalTriggerTask.h.