CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes | Friends
DTLocalTriggerTask Class Reference

#include <DTLocalTriggerTask.h>

Inheritance diagram for DTLocalTriggerTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTLocalTriggerTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerTask ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 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 &)
 Beginrun. More...
 
void runDDUAnalysis (edm::Handle< DTLocalTriggerCollection > &trigsDDU)
 Run analysis on ROS data. More...
 
void runDDUvsTMAnalysis (std::string &trigsrc)
 Run analysis on ROS data. More...
 
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...
 
std::string & topFolder (bool isTM)
 Get the Top folder (different between Physics and TP and TM/DDU) More...
 
void triggerSource (const edm::Event &e)
 Get the L1A source. More...
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Private Attributes

std::string baseFolderDDU
 
std::string baseFolderTM
 
MonitorElementdcc_IDDataErrorPlot
 
edm::EDGetTokenT
< L1MuDTChambPhContainer
dcc_Token_
 
edm::EDGetTokenT
< L1MuDTChambThContainer
dccTh_Token_
 
int dduphcode_best [6][5][13]
 
int dduthcode_best [6][5][13]
 
bool detailedAnalysis
 
std::map< uint32_t, std::map
< std::string, MonitorElement * > > 
digiHistos
 
bool doTMTheta
 
const L1MuDTChambPhDigiiphbest [6][5][13]
 
const DTLocalTriggeriphbestddu [6][5][13]
 
bool isLocalRun
 
const L1MuDTChambThDigiithbest [6][5][13]
 
edm::EDGetTokenT
< LTCDigiCollection
ltcDigiCollectionToken_
 
int mapDTTF [6][13][2]
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
edm::ParameterSet parameters
 
int phcode_best [6][5][13]
 
edm::EDGetTokenT
< DTLocalTriggerCollection
ros_Token_
 
edm::EDGetTokenT
< DTRecSegment4DCollection
seg_Token_
 
int thcode_best [6][5][13]
 
bool tpMode
 
bool track_ok [6][5][15]
 
DTTrigGeomUtilstrigGeomUtils
 
std::string trigsrc
 
bool useDDU
 
bool useSEG
 
bool useTM
 
std::map< int, std::map
< std::string, MonitorElement * > > 
wheelHistos
 

Friends

class DTMonitorModule
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 48 of file DTLocalTriggerTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file DTLocalTriggerTask.cc.

References baseFolderDDU, baseFolderTM, dcc_Token_, dccTh_Token_, detailedAnalysis, doTMTheta, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_FULL_cff::InputTag, isLocalRun, LogTrace, ltcDigiCollectionToken_, parameters, ros_Token_, seg_Token_, and tpMode.

35  :
36  trigGeomUtils(0),
37  isLocalRun(ps.getUntrackedParameter<bool>("localrun", true))
38  {
39  if (!isLocalRun) {
40  ltcDigiCollectionToken_ = consumes<LTCDigiCollection>(
41  ps.getParameter<edm::InputTag>("ltcDigiCollectionTag"));
42  }
43 
44  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Constructor"<<endl;
45 
46  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
47  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis", false);
48  doTMTheta = ps.getUntrackedParameter<bool>("enableTMTheta", false);
49  dcc_Token_ = consumes<L1MuDTChambPhContainer>(
50  edm::InputTag(ps.getUntrackedParameter<string>("dcc_label", "dttpgprod")));
51 // NEW (M.C Fouz July14) Needed, since at least version 710
52  dccTh_Token_ = consumes<L1MuDTChambThContainer>(
53  edm::InputTag(ps.getUntrackedParameter<string>("dcc_label", "dttpgprod")));
54 // end NEW
55 
56  ros_Token_ = consumes<DTLocalTriggerCollection>(
57  edm::InputTag(ps.getUntrackedParameter<string>("ros_label", "dtunpacker")));
58  seg_Token_ = consumes<DTRecSegment4DCollection>(
59  edm::InputTag(ps.getUntrackedParameter<string>("seg_label", "dt4DSegments")));
60 
61  if (tpMode) {
62  baseFolderTM = "DT/11-LocalTriggerTP-TM/";
63  baseFolderDDU = "DT/12-LocalTriggerTP-DDU/";
64  }
65  else {
66  baseFolderTM = "DT/03-LocalTrigger-TM/";
67  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
68  }
69 
70  parameters = ps;
71 
72 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_Token_
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
#define LogTrace(id)
edm::EDGetTokenT< DTLocalTriggerCollection > ros_Token_
edm::EDGetTokenT< L1MuDTChambThContainer > dccTh_Token_
edm::ParameterSet parameters
DTTrigGeomUtils * trigGeomUtils
DTLocalTriggerTask::~DTLocalTriggerTask ( )
virtual

Destructor.

Definition at line 75 of file DTLocalTriggerTask.cc.

References LogTrace, nevents, and trigGeomUtils.

75  {
76 
77  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: analyzed " << nevents << " events" << endl;
78  if (trigGeomUtils) { delete trigGeomUtils; }
79 
80 }
#define LogTrace(id)
DTTrigGeomUtils * trigGeomUtils

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 243 of file DTLocalTriggerTask.cc.

References dcc_Token_, dccTh_Token_, edm::Event::getByToken(), edm::ParameterSet::getUntrackedParameter(), edm::HandleBase::isValid(), nevents, parameters, ros_Token_, runDDUAnalysis(), runDDUvsTMAnalysis(), runSegmentAnalysis(), runTMAnalysis(), seg_Token_, tpMode, triggerSource(), trigsrc, useDDU, useSEG, and useTM.

243  {
244  if (!nevents){
245 
247  e.getByToken(dcc_Token_, l1DTTPGPh);
249  // e.getByToken(dcc_Token_, l1DTTPGTh);// CHANGED (M.C Fouz July14) Needed, since at least version 710
250  e.getByToken(dccTh_Token_, l1DTTPGTh); // CHANGED (F.R.Cavallo Nov14)
251 
252  useTM = (l1DTTPGPh.isValid() || l1DTTPGTh.isValid()) && parameters.getUntrackedParameter<bool>("process_dcc", true) ;
253 
255  e.getByToken(ros_Token_,l1DDUTrigs);
256  useDDU = l1DDUTrigs.isValid() && parameters.getUntrackedParameter<bool>("process_ros", true) ;
257 
258  Handle<DTRecSegment4DCollection> all4DSegments;
259  e.getByToken(seg_Token_, all4DSegments);
260  useSEG = all4DSegments.isValid() && parameters.getUntrackedParameter<bool>("process_seg", true) ;
261 
262  }
263 
264  nevents++;
265 
266  triggerSource(e);
267 
268  if ( useTM ) {
270  e.getByToken(dcc_Token_, l1DTTPGPh);
271  vector<L1MuDTChambPhDigi> const* l1PhTrig = l1DTTPGPh->getContainer();
272 
274  //e.getByToken(dcc_Token_, l1DTTPGTh);// CHANGED (M.C Fouz July14) Needed, since at least version 710
275  e.getByToken(dccTh_Token_, l1DTTPGTh);// CHANGED (F.R. Cavallo Nov14)
276 
277  vector<L1MuDTChambThDigi> const* l1ThTrig = l1DTTPGTh->getContainer();
278 
279  runTMAnalysis(l1PhTrig, l1ThTrig);
280  }
281  if ( useDDU ) {
283  e.getByToken(ros_Token_, l1DDUTrigs);
284 
285  runDDUAnalysis(l1DDUTrigs);
286  }
287  if ( !tpMode && useSEG ) {
289  e.getByToken(seg_Token_, segments4D);
290 
291  runSegmentAnalysis(segments4D);
292  }
293  if ( !tpMode && useTM && useDDU ) {
295  }
296 
297 }
T getUntrackedParameter(std::string const &, T const &) const
void runTMAnalysis(std::vector< L1MuDTChambPhDigi > const *phTrigs, std::vector< L1MuDTChambThDigi > const *thTrigs)
Run analysis on TM data.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_Token_
void runSegmentAnalysis(edm::Handle< DTRecSegment4DCollection > &segments4D)
Run analysis using DT 4D segments.
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< DTLocalTriggerCollection > ros_Token_
void runDDUvsTMAnalysis(std::string &trigsrc)
Run analysis on ROS data.
edm::EDGetTokenT< L1MuDTChambThContainer > dccTh_Token_
edm::ParameterSet parameters
void triggerSource(const edm::Event &e)
Get the L1A source.
void runDDUAnalysis(edm::Handle< DTLocalTriggerCollection > &trigsDDU)
Run analysis on ROS data.
void DTLocalTriggerTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 225 of file DTLocalTriggerTask.cc.

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

225  {
226 
227  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Begin of LS transition" << endl;
228 
229  if(lumiSeg.id().luminosityBlock()%parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
230  for(map<uint32_t, map<string, MonitorElement*> > ::const_iterator histo = digiHistos.begin();
231  histo != digiHistos.end();
232  histo++) {
233  for(map<string, MonitorElement*> ::const_iterator ht = (*histo).second.begin();
234  ht != (*histo).second.end();
235  ht++) {
236  (*ht).second->Reset();
237  }
238  }
239  }
240 
241 }
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
LuminosityBlockNumber_t luminosityBlock() const
edm::ParameterSet parameters
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
void DTLocalTriggerTask::bookBarrelHistos ( DQMStore::IBooker ,
std::string  histoTag 
)
protected

Book the histograms.

Definition at line 300 of file DTLocalTriggerTask.cc.

References DQMStore::IBooker::book1D(), dcc_IDDataErrorPlot, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and topFolder().

Referenced by bookHistograms().

300  {
301 
302  bool isTM = histoTag.substr(0,3) == "TM";
303  ibooker.setCurrentFolder(topFolder(isTM));
304  if (histoTag == "TM_ErrorsChamberID") {
305  dcc_IDDataErrorPlot = ibooker.book1D(histoTag.c_str(),"TM Data ID Error",5,-2,3);
306  dcc_IDDataErrorPlot->setAxisTitle("wheel",1);
307  }
308 
309  return;
310 
311 }
std::string & topFolder(bool isTM)
Get the Top folder (different between Physics and TP and TM/DDU)
MonitorElement * dcc_IDDataErrorPlot
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTLocalTriggerTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Book the histograms.

Implements DQMEDAnalyzer.

Definition at line 90 of file DTLocalTriggerTask.cc.

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

90  {
91 
92  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: bookHistograms" << endl;
93 
94  if(parameters.getUntrackedParameter<bool>("staticBooking", true)) { // Static histo booking
95 
96  vector<string> trigSources;
97  if(parameters.getUntrackedParameter<bool>("localrun", true)) {
98  trigSources.push_back("");
99  }
100  else {
101  trigSources.push_back("_DTonly");
102  trigSources.push_back("_NoDT");
103  trigSources.push_back("_DTalso");
104  }
105  vector<string>::const_iterator trigSrcIt = trigSources.begin();
106  vector<string>::const_iterator trigSrcEnd = trigSources.end();
107 
108  if(parameters.getUntrackedParameter<bool>("process_dcc", true)) {
109  bookBarrelHistos(ibooker, "TM_ErrorsChamberID");
110  }
111 
112  if (tpMode) {
113  for (int stat=1;stat<5;++stat){
114  for (int wh=-2;wh<3;++wh){
115  for (int sect=1;sect<13;++sect){
116  DTChamberId dtChId(wh,stat,sect);
117 
118  if (parameters.getUntrackedParameter<bool>("process_dcc", true)){ // TM data
119  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_BXvsQual"+(*trigSrcIt));
120  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_QualvsPhirad"+(*trigSrcIt));
121  }
122 
123  if (parameters.getUntrackedParameter<bool>("process_ros", true)){ // DDU data
124  bookHistos(ibooker, dtChId,"LocalTriggerPhi","DDU_BXvsQual"+(*trigSrcIt));
125  }
126 
127  }
128  }
129  } // end of loop
130  }
131  else {
132  for (;trigSrcIt!=trigSrcEnd;++trigSrcIt){
133  for (int wh=-2;wh<3;++wh){
134  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
135  parameters.getUntrackedParameter<bool>("process_ros", true)){ // TM+DDU data
136  bookWheelHistos(ibooker, wh,"COM_BXDiff"+(*trigSrcIt));
137  }
138  for (int sect=1;sect<13;++sect){
139  for (int stat=1;stat<5;++stat){
140  DTChamberId dtChId(wh,stat,sect);
141  if (parameters.getUntrackedParameter<bool>("process_dcc", true)){ // TM data
142 
143  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_BXvsQual"+(*trigSrcIt));
144  if (detailedAnalysis) {
145  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_QualvsPhirad"+(*trigSrcIt));
146  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_QualvsPhibend"+(*trigSrcIt));
147  }
148  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_Flag1stvsQual"+(*trigSrcIt));
149  bookHistos(ibooker, dtChId,"LocalTriggerPhi","TM_BestQual"+(*trigSrcIt));
150  if (stat!=4 && doTMTheta){
151  bookHistos(ibooker, dtChId,"LocalTriggerTheta","TM_PositionvsBX"+(*trigSrcIt));
152  }
153 
154  if (parameters.getUntrackedParameter<bool>("process_seg", true)){ // TM + Segemnt
155  bookHistos(ibooker, dtChId,"Segment","TM_PhitkvsPhitrig"+(*trigSrcIt));
156  bookHistos(ibooker, dtChId,"Segment","TM_PhibtkvsPhibtrig"+(*trigSrcIt));
157  bookHistos(ibooker, dtChId,"Segment","TM_PhiResidual"+(*trigSrcIt));
158  bookHistos(ibooker, dtChId,"Segment","TM_PhiResidualvsLUTPhi"+(*trigSrcIt));
159  bookHistos(ibooker, dtChId,"Segment","TM_PhibResidual"+(*trigSrcIt));
160  bookHistos(ibooker, dtChId,"Segment","TM_HitstkvsQualtrig"+(*trigSrcIt));
161  bookHistos(ibooker, dtChId,"Segment","TM_TrackPosvsAngle"+(*trigSrcIt));
162  bookHistos(ibooker, dtChId,"Segment","TM_TrackPosvsAngleandTrig"+(*trigSrcIt));
163  bookHistos(ibooker, dtChId,"Segment","TM_TrackPosvsAngleandTrigHHHL"+(*trigSrcIt));
164  if(stat!=4){
165  bookHistos(ibooker, dtChId,"Segment","TM_TrackThetaPosvsAngle"+(*trigSrcIt)); // theta view
166  bookHistos(ibooker, dtChId,"Segment","TM_TrackThetaPosvsAngleandTrig"+(*trigSrcIt));
167 // bookHistos(ibooker, dtChId,"Segment","TM_TrackThetaPosvsAngleandTrigH"+(*trigSrcIt)); // TM theta quality not available!
168  }
169  }
170 
171  }
172 
173  if (parameters.getUntrackedParameter<bool>("process_ros", true)){ // DDU data
174 
175  bookHistos(ibooker, dtChId,"LocalTriggerPhi","DDU_BXvsQual"+(*trigSrcIt));
176  bookHistos(ibooker, dtChId,"LocalTriggerPhi","DDU_Flag1stvsQual"+(*trigSrcIt));
177  bookHistos(ibooker, dtChId,"LocalTriggerPhi","DDU_BestQual"+(*trigSrcIt));
178  if(stat!=4){ // theta view
179  bookHistos(ibooker, dtChId,"LocalTriggerTheta","DDU_ThetaBXvsQual"+(*trigSrcIt));
180  bookHistos(ibooker, dtChId,"LocalTriggerTheta","DDU_ThetaBestQual"+(*trigSrcIt));
181  }
182 
183  if (parameters.getUntrackedParameter<bool>("process_seg", true)){ // DDU + Segment
184  bookHistos(ibooker, dtChId,"Segment","DDU_HitstkvsQualtrig"+(*trigSrcIt));
185  bookHistos(ibooker, dtChId,"Segment","DDU_TrackPosvsAngle"+(*trigSrcIt));
186  bookHistos(ibooker, dtChId,"Segment","DDU_TrackPosvsAngleandTrig"+(*trigSrcIt));
187  bookHistos(ibooker, dtChId,"Segment","DDU_TrackPosvsAngleandTrigHHHL"+(*trigSrcIt));
188  if(stat!=4){
189  bookHistos(ibooker, dtChId,"Segment","DDU_TrackThetaPosvsAngle"+(*trigSrcIt)); // theta view
190  bookHistos(ibooker, dtChId,"Segment","DDU_TrackThetaPosvsAngleandTrig"+(*trigSrcIt));
191  bookHistos(ibooker, dtChId,"Segment","DDU_TrackThetaPosvsAngleandTrigH"+(*trigSrcIt));
192  }
193  }
194 
195  }
196 
197  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
198  parameters.getUntrackedParameter<bool>("process_ros", true)){ // TM+DDU data
199  bookHistos(ibooker, dtChId,"LocalTriggerPhi","COM_QualDDUvsQualTM"+(*trigSrcIt));
200  }
201 
202  }
203  }
204  for (int sect=13;sect<15;++sect){
205  DTChamberId dtChId(wh,4,sect);
206  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
207  parameters.getUntrackedParameter<bool>("process_seg", true)){ // TM+SEG LUTs data
208  bookHistos(ibooker, dtChId,"Segment","TM_PhitkvsPhitrig"+(*trigSrcIt));
209  bookHistos(ibooker, dtChId,"Segment","TM_PhibtkvsPhibtrig"+(*trigSrcIt));
210  bookHistos(ibooker, dtChId,"Segment","TM_PhiResidual"+(*trigSrcIt));
211  bookHistos(ibooker, dtChId,"Segment","TM_PhiResidualvsLUTPhi"+(*trigSrcIt));
212  bookHistos(ibooker, dtChId,"Segment","TM_PhibResidual"+(*trigSrcIt));
213  }
214  }
215  }
216  }// end of loop
217  }
218 
219  }
220 
221 
222 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
void bookHistos(DQMStore::IBooker &, const DTChamberId &dtCh, std::string folder, std::string histoTag)
edm::ParameterSet parameters
void bookWheelHistos(DQMStore::IBooker &, int wh, std::string histoTag)
Book the histograms.
void bookBarrelHistos(DQMStore::IBooker &, std::string histoTag)
Book the histograms.
void DTLocalTriggerTask::bookHistos ( DQMStore::IBooker ,
const DTChamberId dtCh,
std::string  folder,
std::string  histoTag 
)
protected

Definition at line 313 of file DTLocalTriggerTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), digiHistos, edm::ParameterSet::getUntrackedParameter(), LogTrace, bookConverter::max, min(), pileupCalc::nbins, parameters, DTTrigGeomUtils::phiRange(), DetId::rawId(), reco::return(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), setQLabels(), DTChamberId::station(), relativeConstraints::station, DTTrigGeomUtils::thetaRange(), topFolder(), trigGeomUtils, and DTChamberId::wheel().

Referenced by bookHistograms().

313  {
314 
315  int wh=dtCh.wheel();
316  int sc=dtCh.sector();
317  stringstream wheel; wheel << wh;
318  stringstream station; station << dtCh.station();
319  stringstream sector; sector << sc;
320 
321  double minBX=0;
322  double maxBX=0;
323  int rangeBX=0;
324 
325  string histoType = histoTag.substr(4,histoTag.find("_",4)-4);
326  bool isTM = histoTag.substr(0,3) == "TM";
327 
328  ibooker.setCurrentFolder(topFolder(isTM) + "Wheel" + wheel.str() +
329  "/Sector" + sector.str() +
330  "/Station" + station.str() + "/" + folder);
331 
332  string histoName = histoTag + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
333 
334  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: booking " << topFolder(isTM) << "Wheel" << wheel.str()
335  << "/Sector" << sector.str()
336  << "/Station"<< station.str() << "/" << folder << "/" << histoName << endl;
337 
338  if (histoType.find("BX") != string::npos){
339  if (histoTag.substr(0,3) == "TM"){
340  minBX= parameters.getUntrackedParameter<int>("minBXTM",-2) - 0.5;
341  maxBX= parameters.getUntrackedParameter<int>("maxBXTM",2) + 0.5;
342  }
343  else {
344  minBX= parameters.getUntrackedParameter<int>("minBXDDU",0) - 0.5;
345  maxBX= parameters.getUntrackedParameter<int>("maxBXDDU",20) + 0.5;
346  }
347  rangeBX = (int)(maxBX-minBX);
348  }
349 
350  if ( folder == "LocalTriggerPhi") {
351 
352  if( histoType == "BXvsQual" ){
353  (digiHistos[dtCh.rawId()])[histoTag] =
354  ibooker.book2D(histoName,"BX vs trigger quality",7,-0.5,6.5,rangeBX,minBX,maxBX);
355  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
356  return ;
357  }
358  if( histoType == "BestQual" ){
359  (digiHistos[dtCh.rawId()])[histoTag] =
360  ibooker.book1D(histoName,"Trigger quality of best primitives",7,-0.5,6.5);
361  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
362  return ;
363  }
364  if( histoType == "QualvsPhirad" ){
365  (digiHistos[dtCh.rawId()])[histoTag] =
366  ibooker.book2D(histoName,"Trigger quality vs local position",100,-500.,500.,7,-0.5,6.5);
367  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
368  return ;
369  }
370  if( histoType == "QualvsPhibend" ) {
371  (digiHistos[dtCh.rawId()])[histoTag] =
372  ibooker.book2D(histoName,"Trigger quality vs local direction",200,-40.,40.,7,-0.5,6.5);
373  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
374  return ;
375  }
376  if( histoType == "Flag1stvsQual" ) {
377  (digiHistos[dtCh.rawId()])[histoTag] =
378  ibooker.book2D(histoName,"1st/2nd trig flag vs quality",7,-0.5,6.5,2,-0.5,1.5);
379  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
380  return ;
381  }
382  if( histoType == "QualDDUvsQualTM" ){
383  (digiHistos[dtCh.rawId()])[histoTag] =
384  ibooker.book2D(histoName,"DDU quality vs TM quality",8,-1.5,6.5,8,-1.5,6.5);
385  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
386  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
387  return ;
388  }
389 
390  }
391  else if ( folder == "LocalTriggerTheta") {
392 
393  if( histoType == "PositionvsBX" ) {
394  (digiHistos[dtCh.rawId()])[histoTag] =
395  ibooker.book2D(histoName,"Theta trigger position vs BX",rangeBX,minBX,maxBX,7,-0.5,6.5);
396  return ;
397  }
398  if( histoType == "PositionvsQual" ) {
399  (digiHistos[dtCh.rawId()])[histoTag] =
400  ibooker.book2D(histoName,"Theta trigger position vs quality",7,-0.5,6.5,7,-0.5,6.5);
401  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
402  return ;
403  }
404  if( histoType == "ThetaBXvsQual" ) {
405  (digiHistos[dtCh.rawId()])[histoTag] =
406  ibooker.book2D(histoName,"BX vs trigger quality",7,-0.5,6.5,rangeBX,minBX,maxBX);
407  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
408  }
409  if( histoType == "ThetaBestQual" ){
410  (digiHistos[dtCh.rawId()])[histoTag] =
411  ibooker.book1D(histoName,"Trigger quality of best primitives (theta)",7,-0.5,6.5);
412  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
413  return ;
414  }
415 
416  }
417  else if ( folder == "Segment") {
418 
419  if( histoType.find("TrackThetaPosvsAngle" ) == 0 ) {
420 
421  string histoLabel = "Position vs Angle (theta)";
422  if (histoType.find("andTrigH") != string::npos) histoLabel += " for H triggers";
423  else if (histoType.find("andTrig") != string::npos) histoLabel += " for triggers";
424 
425  float min,max;
426  int nbins;
427  trigGeomUtils->thetaRange(dtCh,min,max,nbins);
428  (digiHistos[dtCh.rawId()])[histoTag] =
429  ibooker.book2D(histoName,histoLabel,16,-40.,40.,nbins,min,max);
430  return ;
431  }
432  if( histoType.find("TrackPosvsAngle") == 0 ){
433 
434  float min,max;
435  int nbins;
436  trigGeomUtils->phiRange(dtCh,min,max,nbins);
437 
438  string histoLabel = "Position vs Angle (phi)";
439  if (histoType.find("andTrigHHHL") != string::npos) histoLabel += " for HH/HL triggers";
440  else if (histoType.find("andTrig") != string::npos) histoLabel += " for triggers";
441 
442  (digiHistos[dtCh.rawId()])[histoTag] =
443  ibooker.book2D(histoName,histoLabel,16,-40.,40.,nbins,min,max);
444  return ;
445  }
446  if( histoType == "PhitkvsPhitrig" ){
447  (digiHistos[dtCh.rawId()])[histoTag] =
448  ibooker.book2D(histoName,"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
449  return ;
450  }
451  if( histoType == "PhibtkvsPhibtrig" ){
452  (digiHistos[dtCh.rawId()])[histoTag] =
453  ibooker.book2D(histoName,"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
454  return ;
455  }
456  if( histoType == "PhiResidual" ){
457  (digiHistos[dtCh.rawId()])[histoTag] =
458  ibooker.book1D(histoName,"Trigger local position - Segment local position (correlated triggers)",400,-10.,10.);
459  return ;
460  }
461  if( histoType == "PhibResidual" ){
462  (digiHistos[dtCh.rawId()])[histoTag] =
463  ibooker.book1D(histoName,"Trigger local direction - Segment local direction (correlated triggers)",500,-10.,10.);
464  return ;
465  }
466  if( histoType == "HitstkvsQualtrig" ){
467  (digiHistos[dtCh.rawId()])[histoTag] =
468  ibooker.book2D(histoName,"Segment hits (phi) vs trigger quality",7,-0.5,6.5,10,0.5,10.5);
469  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
470  return ;
471  }
472 
473  }
474 
475 }
T getUntrackedParameter(std::string const &, T const &) const
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
std::string & topFolder(bool isTM)
Get the Top folder (different between Physics and TP and TM/DDU)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
T min(T a, T b)
Definition: MathUtil.h:58
#define LogTrace(id)
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
void setQLabels(MonitorElement *me, short int iaxis)
Set Quality labels.
return(e1-e2)*(e1-e2)+dp *dp
edm::ParameterSet parameters
DTTrigGeomUtils * trigGeomUtils
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
void DTLocalTriggerTask::bookWheelHistos ( DQMStore::IBooker ,
int  wh,
std::string  histoTag 
)
protected

Book the histograms.

Definition at line 477 of file DTLocalTriggerTask.cc.

References DQMStore::IBooker::bookProfile2D(), LogTrace, reco::return(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), topFolder(), and wheelHistos.

Referenced by bookHistograms().

477  {
478 
479  stringstream wheel; wheel << wh;
480 
481  string histoType = histoTag.substr(4,histoTag.find("_",4)-4);
482  bool isTM = histoTag.substr(0,3) == "TM";
483 
484  ibooker.setCurrentFolder(topFolder(isTM) + "Wheel" + wheel.str() + "/");
485 
486  string histoName = histoTag + "_W" + wheel.str();
487 
488  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: booking " << topFolder(isTM)
489  << "Wheel" << wheel.str() << "/" << histoName << endl;
490 
491  if( histoType.find("BXDiff") != string::npos ){
492  MonitorElement *me = ibooker.bookProfile2D(histoName,"DDU-TM BX Difference",12,1,13,4,1,5,0.,20.);
493  me->setAxisTitle("Sector",1);
494  me->setAxisTitle("station",2);
495  (wheelHistos[wh])[histoTag] = me;
496  return ;
497  }
498 
499 }
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
std::string & topFolder(bool isTM)
Get the Top folder (different between Physics and TP and TM/DDU)
#define LogTrace(id)
return(e1-e2)*(e1-e2)+dp *dp
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DTLocalTriggerTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Beginrun.

Reimplemented from DQMEDAnalyzer.

Definition at line 82 of file DTLocalTriggerTask.cc.

References edm::EventSetup::get(), muonGeom, nevents, and trigGeomUtils.

82  {
83 
84  nevents = 0;
85  context.get<MuonGeometryRecord>().get(muonGeom);
87 
88 }
edm::ESHandle< DTGeometry > muonGeom
const T & get() const
Definition: EventSetup.h:56
DTTrigGeomUtils * trigGeomUtils
void DTLocalTriggerTask::runDDUAnalysis ( edm::Handle< DTLocalTriggerCollection > &  trigsDDU)
protected

Run analysis on ROS data.

Definition at line 615 of file DTLocalTriggerTask.cc.

References dduphcode_best, dduthcode_best, digiHistos, i, iphbestddu, j, relval_2017::k, HLT_FULL_cff::quality, DetId::rawId(), tpMode, and trigsrc.

Referenced by analyze().

615  {
616 
618 
619  for (int i=0;i<5;++i){
620  for (int j=0;j<6;++j){
621  for (int k=0;k<13;++k){
622  dduphcode_best[j][i][k] = -1;
623  dduthcode_best[j][i][k] = -1;
624  }
625  }
626  }
627 
628  for (detUnitIt=trigsDDU->begin();
629  detUnitIt!=trigsDDU->end();
630  ++detUnitIt){
631 
632  const DTChamberId& id = (*detUnitIt).first;
633  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
634  uint32_t indexCh = id.rawId();
635  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
636 
637  int wh = id.wheel();
638  int sec = id.sector();
639  int st = id.station();
640 
641  for (DTLocalTriggerCollection::const_iterator trigIt = range.first;
642  trigIt!=range.second;
643  ++trigIt){
644 
645  int bx = trigIt->bx();
646  int quality = trigIt->quality();
647  int thqual = trigIt->trTheta();
648  int flag1st = trigIt->secondTrack() ? 1 : 0;
649 
650  // check if SC data exist: fill for any trigger
651  if( quality>-1 && quality<7 ) { // it is a phi trigger
652 
653  if(quality>dduphcode_best[wh+3][st][sec]) {
654  dduphcode_best[wh+3][st][sec]=quality;
655  iphbestddu[wh+3][st][sec] = &(*trigIt);
656  }
657 
658  if(tpMode) {
659  innerME.find("DDU_BXvsQual"+trigsrc)->second->Fill(quality,bx-flag1st); // SM BX vs Qual Phi view
660  }
661  else {
662  innerME.find("DDU_BXvsQual"+trigsrc)->second->Fill(quality,bx-flag1st); // SM BX vs Qual Phi view
663  innerME.find("DDU_Flag1stvsQual"+trigsrc)->second->Fill(quality,flag1st); // SM Quality vs 1st/2nd track flag Phi view
664  }
665  }
666  if( thqual>0 && !tpMode ) { // it is a theta trigger
667 
668  if(thqual>dduthcode_best[wh+3][st][sec] ) {
669  dduthcode_best[wh+3][st][sec]=thqual;
670  }
671 
672  innerME.find("DDU_ThetaBXvsQual"+trigsrc)->second->Fill(thqual,bx); // SM BX vs Qual Theta view
673  }
674  }
675 
676  // Fill Quality plots with best ddu triggers in phi & theta
677  if (!tpMode) {
678  if (dduphcode_best[wh+3][st][sec]>-1 &&
679  dduphcode_best[wh+3][st][sec]<7){
680 
681  innerME.find("DDU_BestQual"+trigsrc)->second->Fill(dduphcode_best[wh+3][st][sec]); // Best Qual Trigger Phi view
682  }
683  if (dduthcode_best[wh+3][st][sec]>0){
684  innerME.find("DDU_ThetaBestQual"+trigsrc)->second->Fill(dduthcode_best[wh+3][st][sec]); // Best Qual Trigger Theta view
685  }
686  }
687  }
688 }
int i
Definition: DBlmapReader.cc:9
int dduphcode_best[6][5][13]
int dduthcode_best[6][5][13]
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int j
Definition: DBlmapReader.cc:9
const DTLocalTrigger * iphbestddu[6][5][13]
std::vector< DTLocalTrigger >::const_iterator const_iterator
std::pair< const_iterator, const_iterator > Range
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
void DTLocalTriggerTask::runDDUvsTMAnalysis ( std::string &  trigsrc)
protected

Run analysis on ROS data.

Definition at line 870 of file DTLocalTriggerTask.cc.

References DTLocalTrigger::bx(), L1MuDTChambPhDigi::bxNum(), dduphcode_best, digiHistos, spr::find(), iphbest, iphbestddu, phcode_best, DTLocalTrigger::secondTrack(), L1MuDTChambPhDigi::Ts2Tag(), and wheelHistos.

Referenced by analyze().

870  {
871 
872  string histoType ;
873  string histoTag ;
874 
875  for (int st=1;st<5;++st){
876  for (int wh=-2;wh<3;++wh){
877  for (int sc=1;sc<13;++sc){
878  if ( (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7) ||
879  (dduphcode_best[wh+3][st][sc]>-1 && dduphcode_best[wh+3][st][sc]<7) ){
880  DTChamberId id(wh,st,sc);
881  uint32_t indexCh = id.rawId();
882  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
883 
884  innerME.find("COM_QualDDUvsQualTM"+trigsrc)->second->Fill(phcode_best[wh+3][st][sc],dduphcode_best[wh+3][st][sc]);
885  if ( (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7) &&
886  (dduphcode_best[wh+3][st][sc]>-1 && dduphcode_best[wh+3][st][sc]<7) ){
887  int bxDDU = iphbestddu[wh+3][st][sc]->bx() - iphbestddu[wh+3][st][sc]->secondTrack();
888  int bxTM = iphbest[wh+3][st][sc]->bxNum() - iphbest[wh+3][st][sc]->Ts2Tag();
889  (wheelHistos[wh]).find("COM_BXDiff"+trigsrc)->second->Fill(sc,st,bxDDU-bxTM);
890  }
891  }
892  }
893  }
894  }
895 
896 }
int phcode_best[6][5][13]
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
int dduphcode_best[6][5][13]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const DTLocalTrigger * iphbestddu[6][5][13]
bool secondTrack() const
const L1MuDTChambPhDigi * iphbest[6][5][13]
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
uint16_t bx() const
void DTLocalTriggerTask::runSegmentAnalysis ( edm::Handle< DTRecSegment4DCollection > &  segments4D)
protected

Run analysis using DT 4D segments.

Definition at line 691 of file DTLocalTriggerTask.cc.

References DTRecSegment4D::chamberId(), DTTrigGeomUtils::computeSCCoordinates(), dduphcode_best, dduthcode_best, DTRecSegment2D::degreesOfFreedom(), digiHistos, DTChamberId, iphbest, phcode_best, DTRecSegment4D::phiSegment(), DetId::rawId(), relativeConstraints::station, thcode_best, track_ok, DTTrigGeomUtils::trigDir(), trigGeomUtils, DTTrigGeomUtils::trigPos(), trigsrc, DTTrigGeomUtils::trigToSeg(), useDDU, useTM, and DTChamberId::wheel().

Referenced by analyze().

691  {
692 
694 
695  // Find best tracks & good tracks
696  memset(track_ok,false,450*sizeof(bool));
697 
698  DTRecSegment4DCollection::id_iterator chamberId;
699  vector<const DTRecSegment4D*> best4DSegments;
700 
701  // Preliminary loop finds best 4D Segment and high quality ones
702  for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
703 
704  DTRecSegment4DCollection::range range = segments4D->get(*chamberId);
705  const DTRecSegment4D* tmpBest=0;
706  int tmpdof = 0;
707  int dof = 0;
708 
709  for ( track = range.first; track != range.second; ++track){
710 
711  if( (*track).hasPhi() ) {
712 
713  dof = (*track).phiSegment()->degreesOfFreedom();
714  if ( dof>tmpdof ){
715  tmpBest = &(*track);
716  tmpdof = dof;
717 
718  int wheel = (*track).chamberId().wheel();
719  int sector = (*track).chamberId().sector();
720  int station = (*track).chamberId().station();
721  if (sector==13){
722  sector=4;
723  }
724  else if (sector==14){
725  sector=10;
726  }
727  track_ok[wheel+3][station][sector] = (!track_ok[wheel+3][station][sector] && dof>=2);
728  }
729 
730  }
731  }
732  if (tmpBest) best4DSegments.push_back(tmpBest);
733  }
734 
735  vector<const DTRecSegment4D*>::const_iterator btrack;
736 
737  for ( btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack ){
738 
739  if( (*btrack)->hasPhi() ) { // Phi component
740 
741  int wheel = (*btrack)->chamberId().wheel();
742  int station = (*btrack)->chamberId().station();
743  int sector = (*btrack)->chamberId().sector();
744  int scsector = 0;
745  float x_track, y_track, x_angle, y_angle;
746  trigGeomUtils->computeSCCoordinates((*btrack),scsector,x_track,x_angle,y_track,y_angle);
747  int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom()+2;
748 
749  DTChamberId dtChId(wheel,station,sector); // get chamber for LUTs histograms (Sectors 1 to 14)
750  uint32_t indexCh = dtChId.rawId();
751  map<string, MonitorElement*> &innerMECh = digiHistos[indexCh];
752 
753  DTChamberId dtChIdSC = DTChamberId(wheel,station,scsector); // get chamber for histograms SC granularity (sectors 1 to 12)
754  indexCh = dtChIdSC.rawId();
755  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
756 
757  if (useDDU &&
758  dduphcode_best[wheel+3][station][scsector] > -1 &&
759  dduphcode_best[wheel+3][station][scsector] < 7 ) {
760 
761  // SM hits of the track vs quality of the trigger
762  innerME.find("DDU_HitstkvsQualtrig"+trigsrc)->second->Fill(dduphcode_best[wheel+3][station][scsector],nHitsPhi);
763 
764  }
765 
766  if (useTM &&
767  phcode_best[wheel+3][station][scsector] > -1 &&
768  phcode_best[wheel+3][station][scsector] < 7 ) {
769 
770  innerME.find("TM_HitstkvsQualtrig"+trigsrc)->second->Fill(phcode_best[wheel+3][station][scsector],nHitsPhi);
771 
772  if (phcode_best[wheel+3][station][scsector]>3 && nHitsPhi>=7){
773 
774  float x_trigger = trigGeomUtils->trigPos(iphbest[wheel+3][station][scsector]);
775  float angle_trigger = trigGeomUtils->trigDir(iphbest[wheel+3][station][scsector]);
776  trigGeomUtils->trigToSeg(station,x_trigger,x_angle);
777 
778  innerMECh.find("TM_PhitkvsPhitrig"+trigsrc)->second->Fill(x_trigger,x_track);
779  innerMECh.find("TM_PhibtkvsPhibtrig"+trigsrc)->second->Fill(angle_trigger,x_angle);
780  innerMECh.find("TM_PhiResidual"+trigsrc)->second->Fill(x_trigger-x_track);
781  innerMECh.find("TM_PhibResidual"+trigsrc)->second->Fill(angle_trigger-x_angle);
782  }
783  }
784 
785 
786  if (useTM) {
787 
788  // check for triggers elsewhere in the sector
789  bool trigFlagTM =false;
790  for (int ist=1; ist<5; ist++){
791  if (ist!=station &&
792  phcode_best[wheel+3][ist][scsector]>=2 &&
793  phcode_best[wheel+3][ist][scsector]<7 &&
794  track_ok[wheel+3][ist][scsector]==true){
795  trigFlagTM = true;
796  break;
797  }
798  }
799 
800  if (trigFlagTM && fabs(x_angle)<40. && nHitsPhi>=7){
801 
802  // position vs angle of track for reconstruced tracks (denom. for trigger efficiency)
803  innerME.find("TM_TrackPosvsAngle"+trigsrc)->second->Fill(x_angle,x_track);
804  if (phcode_best[wheel+3][station][scsector] >= 2 && phcode_best[wheel+3][station][scsector] < 7) {
805  innerME.find("TM_TrackPosvsAngleandTrig"+trigsrc)->second->Fill(x_angle,x_track);
806  if (phcode_best[wheel+3][station][scsector] > 4){ //HH & HL Triggers
807  innerME.find("TM_TrackPosvsAngleandTrigHHHL"+trigsrc)->second->Fill(x_angle,x_track);
808  }
809  }
810 
811  }
812 
813  if ((*btrack)->hasZed() && trigFlagTM && fabs(y_angle)<40. && (*btrack)->zSegment()->degreesOfFreedom()>=1){
814 
815  // position va angle of track for reconstruced tracks (denom. for trigger efficiency) along theta direction
816  innerME.find("TM_TrackThetaPosvsAngle"+trigsrc)->second->Fill(y_angle,y_track);
817  if (thcode_best[wheel+3][station][scsector] > 0) {
818  innerME.find("TM_TrackThetaPosvsAngleandTrig"+trigsrc)->second->Fill(y_angle,y_track);
819  }
820 
821  }
822  }
823 
824  if (useDDU) {
825 
826  // check for triggers elsewhere in the sector
827  bool trigFlagDDU =false;
828  for (int ist=1; ist<5; ist++){
829  if (ist!=station &&
830  dduphcode_best[wheel+3][ist][scsector]>=2 &&
831  dduphcode_best[wheel+3][ist][scsector]<7 &&
832  track_ok[wheel+3][ist][scsector]==true){
833  trigFlagDDU = true;
834  break;
835  }
836  }
837 
838  if (trigFlagDDU && fabs(x_angle)<40. && nHitsPhi>=7){
839 
840  // position vs angle of track for reconstruced tracks (denom. for trigger efficiency)
841  innerME.find("DDU_TrackPosvsAngle"+trigsrc)->second->Fill(x_angle,x_track);
842  if (dduphcode_best[wheel+3][station][scsector] >= 2 && dduphcode_best[wheel+3][station][scsector] < 7) {
843  innerME.find("DDU_TrackPosvsAngleandTrig"+trigsrc)->second->Fill(x_angle,x_track);
844  if (dduphcode_best[wheel+3][station][scsector] > 4){ //HH & HL Triggers
845  innerME.find("DDU_TrackPosvsAngleandTrigHHHL"+trigsrc)->second->Fill(x_angle,x_track);
846  }
847  }
848 
849  }
850 
851  if ((*btrack)->hasZed() && trigFlagDDU && fabs(y_angle)<40. && (*btrack)->zSegment()->degreesOfFreedom()>=1){
852 
853  // position va angle of track for reconstruced tracks (denom. for trigger efficiency) along theta direction
854  innerME.find("DDU_TrackThetaPosvsAngle"+trigsrc)->second->Fill(y_angle,y_track);
855  if (dduthcode_best[wheel+3][station][scsector] > 0) {
856  innerME.find("DDU_TrackThetaPosvsAngleandTrig"+trigsrc)->second->Fill(y_angle,y_track);
857  if (dduthcode_best[wheel+3][station][scsector] == 3) {
858  innerME.find("DDU_TrackThetaPosvsAngleandTrigH"+trigsrc)->second->Fill(y_angle,y_track);
859  }
860  }
861 
862  }
863  }
864  }
865  }
866 
867 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
int phcode_best[6][5][13]
virtual int degreesOfFreedom() const
return the DOF of the segment
int thcode_best[6][5][13]
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
int dduphcode_best[6][5][13]
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
bool track_ok[6][5][15]
int dduthcode_best[6][5][13]
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
DTTrigGeomUtils * trigGeomUtils
const L1MuDTChambPhDigi * iphbest[6][5][13]
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
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.
void DTLocalTriggerTask::runTMAnalysis ( std::vector< L1MuDTChambPhDigi > const *  phTrigs,
std::vector< L1MuDTChambThDigi > const *  thTrigs 
)
protected

Run analysis on TM data.

Definition at line 501 of file DTLocalTriggerTask.cc.

References angle(), dcc_IDDataErrorPlot, detailedAnalysis, digiHistos, doTMTheta, MonitorElement::Fill(), i, iphbest, ithbest, j, relval_2017::k, phcode_best, DetId::rawId(), thcode_best, tpMode, DTTrigGeomUtils::trigDir(), trigGeomUtils, DTTrigGeomUtils::trigPos(), trigsrc, and x.

Referenced by analyze().

502  {
503 
504  string histoType ;
505  string histoTag ;
506 
507  // define best quality trigger segment (phi and theta)
508  // in any station start from 1 and zero is kept empty
509  for (int i=0;i<5;++i){
510  for (int j=0;j<6;++j){
511  for (int k=0;k<13;++k){
512  phcode_best[j][i][k] = -1;
513  thcode_best[j][i][k] = -1;
514  }
515  }
516  }
517 
518  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
519  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
520  for(; iph !=iphe ; ++iph) {
521 
522  int phwheel = iph->whNum();
523  int phsec = iph->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
524  int phst = iph->stNum();
525  int phbx = iph->bxNum();
526  int phcode = iph->code();
527  int phi1st = iph->Ts2Tag();
528 
529  // FIXME: workaround for TM data with station ID
530  if(phst == 0) {
531  dcc_IDDataErrorPlot->Fill(phwheel);
532  continue;
533  }
534 
535  if(phcode>phcode_best[phwheel+3][phst][phsec] && phcode<7) {
536  phcode_best[phwheel+3][phst][phsec]=phcode;
537  iphbest[phwheel+3][phst][phsec] = &(*iph);
538  }
539 
540  DTChamberId dtChId(phwheel,phst,phsec);
541 
542  float x = trigGeomUtils->trigPos(&(*iph));
543  float angle = trigGeomUtils->trigDir(&(*iph));
544  uint32_t indexCh = dtChId.rawId();
545 
546  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
547 
548  if (tpMode) {
549  innerME.find("TM_BXvsQual"+trigsrc)->second->Fill(phcode,phbx-phi1st); // SM BX vs Qual Phi view (1st tracks)
550  innerME.find("TM_QualvsPhirad"+trigsrc)->second->Fill(x,phcode); // SM Qual vs radial angle Phi view
551  }
552  else {
553  innerME.find("TM_BXvsQual"+trigsrc)->second->Fill(phcode,phbx-phi1st); // SM BX vs Qual Phi view (1st tracks)
554  innerME.find("TM_Flag1stvsQual"+trigsrc)->second->Fill(phcode,phi1st); // SM Qual 1st/2nd track flag Phi view
555  if (detailedAnalysis) {
556  innerME.find("TM_QualvsPhirad"+trigsrc)->second->Fill(x,phcode); // SM Qual vs radial angle Phi view
557  innerME.find("TM_QualvsPhibend"+trigsrc)->second->Fill(angle,phcode); // SM Qual vs bending Phi view
558  }
559  }
560 
561  }
562 
563  if (doTMTheta) {
564  int thcode[7];
565  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
566  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
567  for(; ith != ithe; ++ith) {
568  int thwheel = ith->whNum();
569  int thsec = ith->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
570  int thst = ith->stNum();
571  int thbx = ith->bxNum();
572 
573  for (int pos=0; pos<7; pos++) {
574  thcode[pos] = ith->code(pos);
575 
576  if(thcode[pos]>thcode_best[thwheel+3][thst][thsec] ) {
577  thcode_best[thwheel+3][thst][thsec]=thcode[pos];
578  ithbest[thwheel+3][thst][thsec] = &(*ith);
579  }
580  }
581 
582  DTChamberId dtChId(thwheel,thst,thsec);
583  uint32_t indexCh = dtChId.rawId();
584 
585  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
586 
587  for (int pos=0; pos<7; pos++) { //SM fill position for non zero position bit in theta view
588  if(thcode[pos]>0){
589  innerME.find("TM_PositionvsBX"+trigsrc)->second->Fill(thbx,pos); // SM BX vs Position Theta view
590  }
591  }
592  }
593  }
594 
595 
596  // Fill Quality plots with best TM triggers in phi & theta
597  if (!tpMode) {
598  for (int st=1;st<5;++st){
599  for (int wh=-2;wh<3;++wh){
600  for (int sc=1;sc<13;++sc){
601  if (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7){
602  DTChamberId id(wh,st,sc);
603  uint32_t indexCh = id.rawId();
604  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
605 
606  innerME.find("TM_BestQual"+trigsrc)->second->Fill(phcode_best[wh+3][st][sc]); // Best Qual Trigger Phi view
607  }
608  }
609  }
610  }
611  }
612 
613 }
int i
Definition: DBlmapReader.cc:9
int phcode_best[6][5][13]
int thcode_best[6][5][13]
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
const L1MuDTChambThDigi * ithbest[6][5][13]
DTTrigGeomUtils * trigGeomUtils
const L1MuDTChambPhDigi * iphbest[6][5][13]
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
MonitorElement * dcc_IDDataErrorPlot
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
void DTLocalTriggerTask::setQLabels ( MonitorElement me,
short int  iaxis 
)
protected

Set Quality labels.

Definition at line 898 of file DTLocalTriggerTask.cc.

References MonitorElement::getTH1(), timingPdfMaker::histo, i, and HLT_FULL_cff::labels.

Referenced by bookHistos().

898  {
899 
900  TH1* histo = me->getTH1();
901  if (!histo) return;
902 
903  TAxis* axis=0;
904  if (iaxis==1) {
905  axis=histo->GetXaxis();
906  }
907  else if(iaxis==2) {
908  axis=histo->GetYaxis();
909  }
910  if (!axis) return;
911 
912  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
913  int istart = axis->GetXmin()<-1 ? 2 : 1;
914  for (int i=0;i<7;i++) {
915  axis->SetBinLabel(i+istart,labels[i].c_str());
916  }
917 
918 }
int i
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
std::string& DTLocalTriggerTask::topFolder ( bool  isTM)
inlineprotected

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

Definition at line 101 of file DTLocalTriggerTask.h.

References baseFolderDDU, and baseFolderTM.

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

101 { return isTM ? baseFolderTM : baseFolderDDU; }
void DTLocalTriggerTask::triggerSource ( const edm::Event e)
protected

Get the L1A source.

Definition at line 920 of file DTLocalTriggerTask.cc.

References edm::Event::getByToken(), i, isLocalRun, ltcDigiCollectionToken_, and trigsrc.

Referenced by analyze().

920  {
921 
922 
923  if (!isLocalRun){
924 
925  Handle<LTCDigiCollection> ltcdigis;
926  e.getByToken(ltcDigiCollectionToken_, ltcdigis);
927 
928  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++){
929 
930  size_t otherTriggerSum=0;
931  for (size_t i = 1; i < 6; i++) {
932  otherTriggerSum += size_t((*ltc_it).HasTriggered(i));
933  }
934  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
935  trigsrc = "_DTonly";
936  else if (!(*ltc_it).HasTriggered(0))
937  trigsrc = "_NoDT";
938  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
939  trigsrc = "_DTalso";
940 
941  }
942  return;
943  }
944 
945  trigsrc = "";
946  return;
947 
948 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462

Friends And Related Function Documentation

friend class DTMonitorModule
friend

Definition at line 50 of file DTLocalTriggerTask.h.

Member Data Documentation

std::string DTLocalTriggerTask::baseFolderDDU
private

Definition at line 116 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and topFolder().

std::string DTLocalTriggerTask::baseFolderTM
private

Definition at line 115 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and topFolder().

MonitorElement* DTLocalTriggerTask::dcc_IDDataErrorPlot
private

Definition at line 137 of file DTLocalTriggerTask.h.

Referenced by bookBarrelHistos(), and runTMAnalysis().

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

Definition at line 105 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

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

Definition at line 106 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

int DTLocalTriggerTask::dduphcode_best[6][5][13]
private

Definition at line 122 of file DTLocalTriggerTask.h.

Referenced by runDDUAnalysis(), runDDUvsTMAnalysis(), and runSegmentAnalysis().

int DTLocalTriggerTask::dduthcode_best[6][5][13]
private

Definition at line 124 of file DTLocalTriggerTask.h.

Referenced by runDDUAnalysis(), and runSegmentAnalysis().

bool DTLocalTriggerTask::detailedAnalysis
private

Definition at line 118 of file DTLocalTriggerTask.h.

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

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

Definition at line 117 of file DTLocalTriggerTask.h.

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

const L1MuDTChambPhDigi* DTLocalTriggerTask::iphbest[6][5][13]
private

Definition at line 126 of file DTLocalTriggerTask.h.

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

const DTLocalTrigger* DTLocalTriggerTask::iphbestddu[6][5][13]
private

Definition at line 127 of file DTLocalTriggerTask.h.

Referenced by runDDUAnalysis(), and runDDUvsTMAnalysis().

bool DTLocalTriggerTask::isLocalRun
private

Definition at line 139 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and triggerSource().

const L1MuDTChambThDigi* DTLocalTriggerTask::ithbest[6][5][13]
private

Definition at line 128 of file DTLocalTriggerTask.h.

Referenced by runTMAnalysis().

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

Definition at line 109 of file DTLocalTriggerTask.h.

Referenced by DTLocalTriggerTask(), and triggerSource().

int DTLocalTriggerTask::mapDTTF[6][13][2]
private

Definition at line 125 of file DTLocalTriggerTask.h.

edm::ESHandle<DTGeometry> DTLocalTriggerTask::muonGeom
private

Definition at line 132 of file DTLocalTriggerTask.h.

Referenced by dqmBeginRun().

int DTLocalTriggerTask::nevents
private

Definition at line 113 of file DTLocalTriggerTask.h.

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

edm::ParameterSet DTLocalTriggerTask::parameters
private
int DTLocalTriggerTask::phcode_best[6][5][13]
private

Definition at line 121 of file DTLocalTriggerTask.h.

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

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

Definition at line 107 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

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

Definition at line 108 of file DTLocalTriggerTask.h.

Referenced by analyze(), and DTLocalTriggerTask().

int DTLocalTriggerTask::thcode_best[6][5][13]
private

Definition at line 123 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis(), and runTMAnalysis().

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

Definition at line 129 of file DTLocalTriggerTask.h.

Referenced by runSegmentAnalysis().

DTTrigGeomUtils* DTLocalTriggerTask::trigGeomUtils
private
std::string DTLocalTriggerTask::trigsrc
private
bool DTLocalTriggerTask::useDDU
private

Definition at line 111 of file DTLocalTriggerTask.h.

Referenced by analyze(), and runSegmentAnalysis().

bool DTLocalTriggerTask::useSEG
private

Definition at line 111 of file DTLocalTriggerTask.h.

Referenced by analyze().

bool DTLocalTriggerTask::useTM
private

Definition at line 111 of file DTLocalTriggerTask.h.

Referenced by analyze(), and runSegmentAnalysis().

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

Definition at line 135 of file DTLocalTriggerTask.h.

Referenced by bookWheelHistos(), and runDDUvsTMAnalysis().