CMS 3D CMS Logo

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

#include <DTLocalTriggerLutTask.h>

Inheritance diagram for DTLocalTriggerLutTask:
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

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 bookHistograms More...
 
 DTLocalTriggerLutTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerLutTask () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 BeginRun. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) final
 
void searchTMBestIn (std::vector< L1MuDTChambPhDigi > const *trigs)
 Find best (highest qual) TM trigger segments. More...
 
void searchTMBestOut (std::vector< L1MuDTChambPhDigi > const *trigs)
 
- 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 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 Member Functions

void bookHistos (DQMStore::IBooker &ibooker, DTChamberId chId)
 Book histos. More...
 
std::string & topFolder ()
 Get the top folder. More...
 

Private Attributes

std::string baseFolder
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
 
bool detailedAnalysis
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nEvents
 
int nLumis
 
int nPhibBins
 
int nPhiBins
 
bool overUnderIn
 
edm::ParameterSet parameters
 
double rangePhi
 
double rangePhiB
 
edm::EDGetTokenT< DTRecSegment4DCollectionseg_Token_
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_TokenIn_
 
edm::EDGetTokenT< L1MuDTChambPhContainertm_TokenOut_
 
DTArr3bool track_ok
 
DTArr3Digi trigBestIn
 
DTArr3Digi trigBestOut
 
DTTrigGeomUtilstrigGeomUtils
 
DTArr3int trigQualBestIn
 
DTArr3int trigQualBestOut
 
std::map< int, std::map< std::string, MonitorElement * > > whHistos
 

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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 42 of file DTLocalTriggerLutTask.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerLutTask()

DTLocalTriggerLutTask::DTLocalTriggerLutTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file DTLocalTriggerLutTask.cc.

References baseFolder, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, nEvents, nLumis, nPhibBins, nPhiBins, overUnderIn, parameters, rangePhi, rangePhiB, seg_Token_, tm_TokenIn_, and tm_TokenOut_.

35  esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", ps.getUntrackedParameter<string>("geomLabel")))),
36  trigGeomUtils(nullptr) {
37  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerLutTask") << "[DTLocalTriggerLutTask]: Constructor" << endl;
38 
39  tm_TokenIn_ = consumes<L1MuDTChambPhContainer>(ps.getUntrackedParameter<InputTag>("inputTagTMin"));
40  tm_TokenOut_ = consumes<L1MuDTChambPhContainer>(ps.getUntrackedParameter<InputTag>("inputTagTMout"));
41  seg_Token_ = consumes<DTRecSegment4DCollection>(ps.getUntrackedParameter<InputTag>("inputTagSEG"));
42 
43  overUnderIn = ps.getUntrackedParameter<bool>("rebinOutFlowsInGraph");
44  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis");
45 
46  if (detailedAnalysis) {
47  nPhiBins = 401;
48  rangePhi = 10.025;
49  nPhibBins = 401;
50  rangePhiB = 10.025;
51  } else {
52  nPhiBins = 51;
53  rangePhi = 5.1;
54  nPhibBins = 51;
55  rangePhiB = 10.2;
56  }
57 
58  baseFolder = "DT/03-LocalTrigger-TM/";
59  parameters = ps;
60 
61  nEvents = 0;
62  nLumis = 0;
63 }
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
edm::ParameterSet parameters
#define LogTrace(id)
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenOut_
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenIn_
DTTrigGeomUtils * trigGeomUtils

◆ ~DTLocalTriggerLutTask()

DTLocalTriggerLutTask::~DTLocalTriggerLutTask ( )
override

Destructor.

Definition at line 65 of file DTLocalTriggerLutTask.cc.

References LogTrace, nEvents, and trigGeomUtils.

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

Member Function Documentation

◆ analyze()

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

Analyze.

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

Definition at line 176 of file DTLocalTriggerLutTask.cc.

References chHistos, DTTrigGeomUtils::computeSCCoordinates(), detailedAnalysis, MillePedeFileConverter_cfg::e, L1MuDTChambPhContainer::getContainer(), SiStripPI::max, SiStripPI::min, nEvents, overUnderIn, rangePhi, rangePhiB, DetId::rawId(), searchTMBestIn(), searchTMBestOut(), seg_Token_, DTChamberId::station(), relativeConstraints::station, tm_TokenIn_, tm_TokenOut_, trigBestIn, trigBestOut, DTTrigGeomUtils::trigDir(), trigGeomUtils, DTTrigGeomUtils::trigPos(), trigQualBestIn, trigQualBestOut, DTTrigGeomUtils::trigToSeg(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

176  {
177  nEvents++;
178 
180  e.getByToken(tm_TokenIn_, trigHandleIn);
182  e.getByToken(tm_TokenOut_, trigHandleOut);
183 
184  vector<L1MuDTChambPhDigi> const* trigsIn = trigHandleIn->getContainer();
185  searchTMBestIn(trigsIn);
186  vector<L1MuDTChambPhDigi> const* trigsOut = trigHandleOut->getContainer();
187  searchTMBestOut(trigsOut);
188 
190  e.getByToken(seg_Token_, segments4D);
192 
193  // Preliminary loop finds best 4D Segment and high quality ones
194  vector<const DTRecSegment4D*> best4DSegments;
195 
196  for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId) {
197  DTRecSegment4DCollection::range rangeInCh = segments4D->get(*chamberId);
198  DTRecSegment4DCollection::const_iterator trackIt = rangeInCh.first;
199  DTRecSegment4DCollection::const_iterator trackEnd = rangeInCh.second;
200 
201  const DTRecSegment4D* tmpBest = nullptr;
202  int tmpdof = 0;
203  int dof = 0;
204 
205  for (; trackIt != trackEnd; ++trackIt) {
206  if (trackIt->hasPhi()) {
207  dof = trackIt->phiSegment()->degreesOfFreedom();
208  if (dof > tmpdof) {
209  tmpBest = &(*trackIt);
210  tmpdof = dof;
211  }
212  }
213  }
214 
215  if (tmpBest)
216  best4DSegments.push_back(tmpBest);
217  }
218 
219  vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
220  vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
221 
222  for (; bestTrackIt != bestTrackEnd; ++bestTrackIt) {
223  if ((*bestTrackIt)->hasPhi()) {
224  DTChamberId chId = (*bestTrackIt)->chamberId();
225  int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom() + 2;
226 
227  int wheel = chId.wheel();
228  int station = chId.station();
229  int scsector = 0;
230  float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
231  trigGeomUtils->computeSCCoordinates((*bestTrackIt), scsector, trackPosPhi, trackDirPhi, trackPosEta, trackDirEta);
232 
233  map<string, MonitorElement*>& chMap = chHistos[chId.rawId()];
234  // In part
235  if (trigQualBestIn[wheel + 3][station][scsector] > 3 && // residuals only for correlate triggers
236  trigQualBestIn[wheel + 3][station][scsector] < 7 && nHitsPhi >= 7) {
237  float trigPos = trigGeomUtils->trigPos(trigBestIn[wheel + 3][station][scsector]);
238  float trigDir = trigGeomUtils->trigDir(trigBestIn[wheel + 3][station][scsector]);
239  trigGeomUtils->trigToSeg(station, trigPos, trackDirPhi);
240 
241  double deltaPos = trigPos - trackPosPhi;
242  deltaPos = overUnderIn ? max(min(deltaPos, rangePhi - 0.01), -rangePhi + 0.01) : deltaPos;
243  double deltaDir = trigDir - trackDirPhi;
244  deltaDir = overUnderIn ? max(min(deltaDir, rangePhiB - 0.01), -rangePhiB + 0.01) : deltaDir;
245  chMap.find("TM_PhiResidualIn")->second->Fill(deltaPos);
246  chMap.find("TM_PhibResidualIn")->second->Fill(deltaDir);
247 
248  if (detailedAnalysis) {
249  chMap.find("TM_PhitkvsPhitrig")->second->Fill(trigPos, trackPosPhi);
250  chMap.find("TM_PhibtkvsPhibtrig")->second->Fill(trigDir, trackDirPhi);
251  chMap.find("TM_PhibResidualvsTkPos")->second->Fill(trackPosPhi, trigDir - trackDirPhi);
252  chMap.find("TM_PhiResidualvsTkPos")->second->Fill(trackPosPhi, trigPos - trackPosPhi);
253  }
254  }
255 
256  // Out part
257  if (trigQualBestOut[wheel + 3][station][scsector] > 3 && // residuals only for correlate triggers
258  trigQualBestOut[wheel + 3][station][scsector] < 7 && nHitsPhi >= 7) {
259  float trigPos = trigGeomUtils->trigPos(trigBestOut[wheel + 3][station][scsector]);
260  float trigDir = trigGeomUtils->trigDir(trigBestOut[wheel + 3][station][scsector]);
261  trigGeomUtils->trigToSeg(station, trigPos, trackDirPhi);
262 
263  double deltaPos = trigPos - trackPosPhi;
264  deltaPos = overUnderIn ? max(min(deltaPos, rangePhi - 0.01), -rangePhi + 0.01) : deltaPos;
265  double deltaDir = trigDir - trackDirPhi;
266  deltaDir = overUnderIn ? max(min(deltaDir, rangePhiB - 0.01), -rangePhiB + 0.01) : deltaDir;
267  chMap.find("TM_PhiResidualOut")->second->Fill(deltaPos);
268  chMap.find("TM_PhibResidualOut")->second->Fill(deltaDir);
269  }
270  }
271  }
272 }
int station() const
Return the station number.
Definition: DTChamberId.h:45
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
void searchTMBestOut(std::vector< L1MuDTChambPhDigi > const *trigs)
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
identifier iterator
Definition: RangeMap.h:130
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenOut_
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
void searchTMBestIn(std::vector< L1MuDTChambPhDigi > const *trigs)
Find best (highest qual) TM trigger segments.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenIn_
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
DTTrigGeomUtils * trigGeomUtils
Phi_Container const * getContainer() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.

◆ beginLuminosityBlock()

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

To reset the MEs.

Definition at line 157 of file DTLocalTriggerLutTask.cc.

References chHistos, edm::ParameterSet::getUntrackedParameter(), LogTrace, nLumis, and parameters.

157  {
158  nLumis++;
159  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerLutTask") << "[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
160 
161  if (nLumis % parameters.getUntrackedParameter<int>("ResetCycle") == 0) {
162  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerLutTask") << "[DTLocalTriggerLutTask]: Cleaning histos" << endl;
163  map<uint32_t, map<string, MonitorElement*> >::const_iterator chambIt = chHistos.begin();
164  map<uint32_t, map<string, MonitorElement*> >::const_iterator chambEnd = chHistos.end();
165 
166  for (; chambIt != chambEnd; ++chambIt) {
167  map<string, MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
168  map<string, MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
169  for (; histoIt != histoEnd; ++histoIt) {
170  histoIt->second->Reset();
171  }
172  }
173  }
174 }
edm::ParameterSet parameters
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos

◆ bookHistograms()

void DTLocalTriggerLutTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  context 
)
overridevirtual

bookHistograms

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

Definition at line 145 of file DTLocalTriggerLutTask.cc.

References bookHistos(), DTGeometry::chambers(), LogTrace, and muonGeom.

147  {
148  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerLutTask") << "[DTLocalTriggerLutTask]: bookHistograms" << endl;
149 
150  std::vector<const DTChamber*>::const_iterator chambIt = muonGeom->chambers().begin();
151  std::vector<const DTChamber*>::const_iterator chambEnd = muonGeom->chambers().end();
152 
153  for (; chambIt != chambEnd; ++chambIt)
154  bookHistos(ibooker, (*chambIt)->id());
155 }
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Book histos.
const DTGeometry * muonGeom
#define LogTrace(id)
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84

◆ bookHistos()

void DTLocalTriggerLutTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chId 
)
private

Book histos.

Definition at line 79 of file DTLocalTriggerLutTask.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), chHistos, detailedAnalysis, nPhibBins, nPhiBins, rangePhi, rangePhiB, DetId::rawId(), nano_mu_digi_cff::sector, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, topFolder(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

79  {
80  stringstream wheel;
81  wheel << chId.wheel();
82  stringstream sector;
83  sector << chId.sector();
84  stringstream station;
85  station << chId.station();
86 
87  ibooker.setCurrentFolder(topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() +
88  "/Segment");
89 
90  string chTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
91  std::map<std::string, MonitorElement*>& chambMap = chHistos[chId.rawId()];
92 
93  string hName = "TM_PhiResidualIn";
94 
95  chambMap[hName] = ibooker.book1D(hName + chTag,
96  "Trigger local position In - Segment local position (correlated triggers)",
97  nPhiBins,
98  -rangePhi,
99  rangePhi);
100 
101  hName = "TM_PhiResidualOut";
102 
103  chambMap[hName] = ibooker.book1D(hName + chTag,
104  "Trigger local position Out - Segment local position (correlated triggers)",
105  nPhiBins,
106  -rangePhi,
107  rangePhi);
108 
109  hName = "TM_PhibResidualIn";
110 
111  chambMap[hName] = ibooker.book1D(hName + chTag,
112  "Trigger local direction In - Segment local direction (correlated triggers)",
113  nPhibBins,
114  -rangePhiB,
115  rangePhiB);
116 
117  hName = "TM_PhibResidualOut";
118 
119  chambMap[hName] = ibooker.book1D(hName + chTag,
120  "Trigger local direction Out - Segment local direction (correlated triggers)",
121  nPhibBins,
122  -rangePhiB,
123  rangePhiB);
124 
125  if (detailedAnalysis) {
126  hName = "TM_PhitkvsPhitrig";
127 
128  chambMap[hName] =
129  ibooker.book2D(hName + chTag, "Local position: segment vs trigger", 100, -500., 500., 100, -500., 500.);
130  hName = "TM_PhibtkvsPhibtrig";
131 
132  chambMap[hName] =
133  ibooker.book2D(hName + chTag, "Local direction : segment vs trigger", 200, -40., 40., 200, -40., 40.);
134  hName = "TM_PhibResidualvsTkPos";
135 
136  chambMap[hName] =
137  ibooker.book2D(hName + chTag, "Local direction residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
138  hName = "TM_PhiResidualvsTkPos";
139 
140  chambMap[hName] =
141  ibooker.book2D(hName + chTag, "Local Position residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
142  }
143 }
int station() const
Return the station number.
Definition: DTChamberId.h:45
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string & topFolder()
Get the top folder.
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginRun()

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

BeginRun.

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

Definition at line 73 of file DTLocalTriggerLutTask.cc.

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

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

◆ endLuminosityBlock()

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

Definition at line 68 of file DTLocalTriggerLutTask.h.

68 {}

◆ searchTMBestIn()

void DTLocalTriggerLutTask::searchTMBestIn ( std::vector< L1MuDTChambPhDigi > const *  trigs)
protected

Find best (highest qual) TM trigger segments.

Definition at line 274 of file DTLocalTriggerLutTask.cc.

References dtResolutionTest_cfi::histoTag, l1tGTMenu_lepSeeds_cff::qual, fileinputsource_cfi::sec, trigBestIn, trigQualBestIn, and wheelArrayShift.

Referenced by analyze().

274  {
275  string histoType;
276  string histoTag;
277 
278  // define best quality trigger segment
279  // start from 1 and zero is kept empty
280  for (int st = 0; st <= 4; ++st)
281  for (int wh = 0; wh <= 5; ++wh)
282  for (int sec = 0; sec <= 12; ++sec)
283  trigQualBestIn[wh][st][sec] = -1;
284 
285  vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
286  vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
287  for (; trigIt != trigEnd; ++trigIt) {
288  int wh = trigIt->whNum();
289  int sec = trigIt->scNum() + 1; // DTTF -> DT sector range transform
290  int st = trigIt->stNum();
291  int qual = trigIt->code();
292 
293  if (qual > trigQualBestIn[wh + wheelArrayShift][st][sec] && qual < 7) {
294  trigQualBestIn[wh + wheelArrayShift][st][sec] = qual;
295  trigBestIn[wh + wheelArrayShift][st][sec] = &(*trigIt);
296  }
297  }
298 }

◆ searchTMBestOut()

void DTLocalTriggerLutTask::searchTMBestOut ( std::vector< L1MuDTChambPhDigi > const *  trigs)
protected

Definition at line 300 of file DTLocalTriggerLutTask.cc.

References dtResolutionTest_cfi::histoTag, l1tGTMenu_lepSeeds_cff::qual, fileinputsource_cfi::sec, trigBestOut, trigQualBestOut, and wheelArrayShift.

Referenced by analyze().

300  {
301  string histoType;
302  string histoTag;
303 
304  // define best quality trigger segment
305  // // start from 1 and zero is kept empty
306  for (int st = 0; st <= 4; ++st)
307  for (int wh = 0; wh <= 5; ++wh)
308  for (int sec = 0; sec <= 12; ++sec)
309  trigQualBestOut[wh][st][sec] = -1;
310 
311  vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
312  vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
313  for (; trigIt != trigEnd; ++trigIt) {
314  int wh = trigIt->whNum();
315  int sec = trigIt->scNum() + 1; // DTTF -> DT sector range transform
316  int st = trigIt->stNum();
317  int qual = trigIt->code();
318 
319  if (qual > trigQualBestOut[wh + wheelArrayShift][st][sec] && qual < 7) {
321  trigBestOut[wh + wheelArrayShift][st][sec] = &(*trigIt);
322  }
323  }
324 }

◆ topFolder()

std::string& DTLocalTriggerLutTask::topFolder ( )
inlineprivate

Get the top folder.

Definition at line 74 of file DTLocalTriggerLutTask.h.

References baseFolder.

Referenced by bookHistos().

74 { return baseFolder; }

Friends And Related Function Documentation

◆ DTMonitorModule

friend class DTMonitorModule
friend

Definition at line 43 of file DTLocalTriggerLutTask.h.

Member Data Documentation

◆ baseFolder

std::string DTLocalTriggerLutTask::baseFolder
private

Definition at line 85 of file DTLocalTriggerLutTask.h.

Referenced by DTLocalTriggerLutTask(), and topFolder().

◆ chHistos

std::map<uint32_t, std::map<std::string, MonitorElement*> > DTLocalTriggerLutTask::chHistos
private

Definition at line 104 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistos().

◆ detailedAnalysis

bool DTLocalTriggerLutTask::detailedAnalysis
private

Definition at line 86 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), bookHistos(), and DTLocalTriggerLutTask().

◆ muonGeom

const DTGeometry* DTLocalTriggerLutTask::muonGeom
private

Definition at line 101 of file DTLocalTriggerLutTask.h.

Referenced by bookHistograms(), and dqmBeginRun().

◆ muonGeomToken_

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

Definition at line 100 of file DTLocalTriggerLutTask.h.

Referenced by dqmBeginRun().

◆ nEvents

int DTLocalTriggerLutTask::nEvents
private

◆ nLumis

int DTLocalTriggerLutTask::nLumis
private

Definition at line 81 of file DTLocalTriggerLutTask.h.

Referenced by beginLuminosityBlock(), and DTLocalTriggerLutTask().

◆ nPhibBins

int DTLocalTriggerLutTask::nPhibBins
private

Definition at line 82 of file DTLocalTriggerLutTask.h.

Referenced by bookHistos(), and DTLocalTriggerLutTask().

◆ nPhiBins

int DTLocalTriggerLutTask::nPhiBins
private

Definition at line 82 of file DTLocalTriggerLutTask.h.

Referenced by bookHistos(), and DTLocalTriggerLutTask().

◆ overUnderIn

bool DTLocalTriggerLutTask::overUnderIn
private

Definition at line 87 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and DTLocalTriggerLutTask().

◆ parameters

edm::ParameterSet DTLocalTriggerLutTask::parameters
private

Definition at line 99 of file DTLocalTriggerLutTask.h.

Referenced by beginLuminosityBlock(), and DTLocalTriggerLutTask().

◆ rangePhi

double DTLocalTriggerLutTask::rangePhi
private

Definition at line 83 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), bookHistos(), and DTLocalTriggerLutTask().

◆ rangePhiB

double DTLocalTriggerLutTask::rangePhiB
private

Definition at line 83 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), bookHistos(), and DTLocalTriggerLutTask().

◆ seg_Token_

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

Definition at line 91 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and DTLocalTriggerLutTask().

◆ tm_TokenIn_

edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerLutTask::tm_TokenIn_
private

Definition at line 89 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and DTLocalTriggerLutTask().

◆ tm_TokenOut_

edm::EDGetTokenT<L1MuDTChambPhContainer> DTLocalTriggerLutTask::tm_TokenOut_
private

Definition at line 90 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and DTLocalTriggerLutTask().

◆ track_ok

DTArr3bool DTLocalTriggerLutTask::track_ok
private

Definition at line 97 of file DTLocalTriggerLutTask.h.

◆ trigBestIn

DTArr3Digi DTLocalTriggerLutTask::trigBestIn
private

Definition at line 95 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and searchTMBestIn().

◆ trigBestOut

DTArr3Digi DTLocalTriggerLutTask::trigBestOut
private

Definition at line 96 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and searchTMBestOut().

◆ trigGeomUtils

DTTrigGeomUtils* DTLocalTriggerLutTask::trigGeomUtils
private

Definition at line 102 of file DTLocalTriggerLutTask.h.

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

◆ trigQualBestIn

DTArr3int DTLocalTriggerLutTask::trigQualBestIn
private

Definition at line 93 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and searchTMBestIn().

◆ trigQualBestOut

DTArr3int DTLocalTriggerLutTask::trigQualBestOut
private

Definition at line 94 of file DTLocalTriggerLutTask.h.

Referenced by analyze(), and searchTMBestOut().

◆ wheelArrayShift

const int DTLocalTriggerLutTask::wheelArrayShift = 3
protected

Definition at line 70 of file DTLocalTriggerLutTask.h.

Referenced by searchTMBestIn(), and searchTMBestOut().

◆ whHistos

std::map<int, std::map<std::string, MonitorElement*> > DTLocalTriggerLutTask::whHistos
private

Definition at line 105 of file DTLocalTriggerLutTask.h.