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
DTTestPulsesTask Class Reference

#include <DTTestPulsesTask.h>

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

Public Member Functions

 DTTestPulsesTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTTestPulsesTask ()
 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
 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 (const std::string &iProcessName, std::vector< const char * > &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 bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookHistos (DQMStore::IBooker &ibooker, std::string folder, std::string histoTag)
 Book the ME. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 BeginRun. More...
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

edm::EDGetTokenT
< DTDigiCollection
dtDigisToken_
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
edm::ParameterSet parameters
 
edm::ESHandle< DTRangeT0t0RangeMap
 
std::pair< int, int > t0sPeakRange
 
std::map< int, MonitorElement * > testPulsesOccupancies
 
std::map< int, MonitorElement * > testPulsesProfiles
 
std::map< int, MonitorElement * > testPulsesTimeBoxes
 

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
 
- 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 40 of file DTTestPulsesTask.h.

Constructor & Destructor Documentation

DTTestPulsesTask::DTTestPulsesTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file DTTestPulsesTask.cc.

References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), HLT_25ns14e33_v1_cff::InputTag, Parameters::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.

34  {
35 
36 
37  cout<<"[DTTestPulseTask]: Constructor"<<endl;
38  dtDigisToken_ = consumes<DTDigiCollection>(
39  edm::InputTag(ps.getUntrackedParameter<std::string>("dtdigis", "dtunpacker")));
40 
41  parameters = ps;
42 
43 
44  t0sPeakRange = make_pair( parameters.getUntrackedParameter<int>("t0sRangeLowerBound", -100),
45  parameters.getUntrackedParameter<int>("t0sRangeUpperBound", 100));
46 
47 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
edm::ParameterSet parameters
std::pair< int, int > t0sPeakRange
tuple cout
Definition: gather_cfg.py:121
DTTestPulsesTask::~DTTestPulsesTask ( )
virtual

Destructor.

Definition at line 49 of file DTTestPulsesTask.cc.

References gather_cfg::cout, and cmsHarvester::nevents.

49  {
50 
51  cout <<"[DTTestPulsesTask]: analyzed " << nevents << " events" << endl;
52 
53 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 198 of file DTTestPulsesTask.cc.

References edm::Event::getByToken(), cmsHarvester::nevents, and edm::second().

198  {
199 
200  nevents++;
201 
203  e.getByToken(dtDigisToken_, dtdigis);
204 
206  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
207 
208  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
209  digiIt!=((*dtLayerId_It).second).second; ++digiIt){
210 
211  // for clearness..
212  int layerIndex = ((*dtLayerId_It).first).rawId();
213  int chIndex = ((*dtLayerId_It).first).chamberId().rawId();
214 
215 
216  if ((int)(*digiIt).countsTDC() > t0sPeakRange.first &&
217  (int)(*digiIt).countsTDC() < t0sPeakRange.second ) {
218 
219  // Occupancies
220 
221  testPulsesOccupancies.find(layerIndex)->second->Fill((*digiIt).wire());
222 
223  // Profiles
224 
225  testPulsesProfiles.find(layerIndex)->second->Fill((*digiIt).wire(),(*digiIt).countsTDC());
226  }
227 
228  // Time Box
229 
230  testPulsesTimeBoxes.find(chIndex)->second->Fill((*digiIt).countsTDC());
231  }
232  }
233 
234 }
std::map< int, MonitorElement * > testPulsesOccupancies
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< DTDigiCollection > dtDigisToken_
U second(std::pair< T, U > const &p)
std::pair< int, int > t0sPeakRange
std::vector< DTDigi >::const_iterator const_iterator
std::map< int, MonitorElement * > testPulsesTimeBoxes
std::map< int, MonitorElement * > testPulsesProfiles
void DTTestPulsesTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 63 of file DTTestPulsesTask.cc.

References bookHistos().

63  {
64 
65  bookHistos( ibooker, string("TPOccupancy"), string("TestPulses") );
66  bookHistos( ibooker, string("TPProfile"), string("TestPulses2D") );
67  bookHistos( ibooker, string("TPTimeBox"), string("TestPulsesTB") );
68 }
void bookHistos(DQMStore::IBooker &ibooker, std::string folder, std::string histoTag)
Book the ME.
void DTTestPulsesTask::bookHistos ( DQMStore::IBooker ibooker,
std::string  folder,
std::string  histoTag 
)
protected

Book the ME.

Definition at line 70 of file DTTestPulsesTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookProfile(), DTSuperLayerId::chamberId(), gather_cfg::cout, DTLayerId, hltbtagharvestinganalyzer_cfi::histoName, DTLayerId::layer(), Parameters::parameters, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), and DTChamberId::wheel().

70  {
71 
72  cout<<"[DTTestPulseTask]: booking"<<endl;
73 
74 //here put the static booking loop
75 
76  // Loop over all the chambers
77  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
78  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
79 
80  for (; ch_it != ch_end; ++ch_it) {
81 
82  // Loop over the SLs
83  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
84  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
85 
86  for(; sl_it != sl_end; ++sl_it) {
87  DTSuperLayerId sl = (*sl_it)->id();
88  stringstream superLayer; superLayer << sl.superlayer();
89 
90  // Loop over the Ls
91  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
92  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
93 
94  for(; l_it != l_end; ++l_it) {
95  DTLayerId layerId = (*l_it)->id();
96  stringstream layer; layer << layerId.layer();
97 
98  stringstream superLayer; superLayer << layerId.superlayer();
99  stringstream station; station << layerId.superlayerId().chamberId().station();
100  stringstream sector; sector << layerId.superlayerId().chamberId().sector();
101  stringstream wheel; wheel << layerId.superlayerId().chamberId().wheel();
102 
103  // TP Profiles
104  if ( folder == "TPProfile" ) {
105 
106  const int nWires = (*l_it)->specificTopology().channels();
107 
108  ibooker.setCurrentFolder("DT/DTTestPulsesTask/Wheel" + wheel.str() +
109  "/Station" + station.str() +
110  "/Sector" + sector.str() +
111  "/SuperLayer" + superLayer.str() +
112  "/" +folder);
113 
114  string histoName = histoTag
115  + "_W" + wheel.str()
116  + "_St" + station.str()
117  + "_Sec" + sector.str()
118  + "_SL" + superLayer.str()
119  + "_L" + layer.str();
120 
121  // Setting the range
122  if ( parameters.getUntrackedParameter<bool>("readDB", false) ) {
123  t0RangeMap->slRangeT0( layerId.superlayerId() , t0sPeakRange.first, t0sPeakRange.second);
124  }
125 
126 
127  cout<<"t0sRangeLowerBound "<<t0sPeakRange.first<<"; "
128  <<"t0sRangeUpperBound "<<t0sPeakRange.second<<endl;
129 
130 
131  testPulsesProfiles[int(DTLayerId(layerId.wheel(),
132  layerId.station(),
133  layerId.sector(),
134  layerId.superlayer(),
135  layerId.layer()).rawId())] =
136  ibooker.bookProfile(histoName,histoName,
137  nWires, 0, nWires, // Xaxis: channels
138  t0sPeakRange.first - t0sPeakRange.second, t0sPeakRange.first, t0sPeakRange.second); // Yaxis: times
139  }
140 
141  // TP Occupancies
142  else if ( folder == "TPOccupancy" ) {
143 
144  ibooker.setCurrentFolder("DT/DTTestPulsesTask/Wheel" + wheel.str() +
145  "/Station" + station.str() +
146  "/Sector" + sector.str() +
147  "/SuperLayer" + superLayer.str() +
148  "/" +folder);
149 
150  string histoName = histoTag
151  + "_W" + wheel.str()
152  + "_St" + station.str()
153  + "_Sec" + sector.str()
154  + "_SL" + superLayer.str()
155  + "_L" + layer.str();
156 
157  const int nWires = muonGeom->layer(DTLayerId(layerId.wheel(),
158  layerId.station(),
159  layerId.sector(),
160  layerId.superlayer(),
161  layerId.layer()))->specificTopology().channels();
162 
163  testPulsesOccupancies[int(DTLayerId(layerId.wheel(),
164  layerId.station(),
165  layerId.sector(),
166  layerId.superlayer(),
167  layerId.layer()).rawId())] =
168  ibooker.book1D(histoName, histoName, nWires, 0, nWires);
169  }
170 
171  // Time Box per Chamber
172  else if ( folder == "TPTimeBox" ) {
173 
174  ibooker.setCurrentFolder("DT/DTTestPulsesTask/Wheel" + wheel.str() +
175  "/Station" + station.str() +
176  "/Sector" + sector.str() +
177  "/" +folder);
178 
179  string histoName = histoTag
180  + "_W" + wheel.str()
181  + "_St" + station.str()
182  + "_Sec" + sector.str();
183 
184  testPulsesTimeBoxes[int( DTLayerId(layerId.wheel(),
185  layerId.station(),
186  layerId.sector(),
187  layerId.superlayer(),
188  layerId.layer()).chamberId().rawId())] =
189  ibooker.book1D(histoName, histoName, 10000, 0, 10000); // Overview of the TP (and noise) times
190  }
191 
192  } // close loop on layers
193  } // close loop on superlayers
194  } // close loop on chambers
195 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, MonitorElement * > testPulsesOccupancies
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
DTChamberId chamberId() const
Return the corresponding ChamberId.
edm::ESHandle< DTRangeT0 > t0RangeMap
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
edm::ESHandle< DTGeometry > muonGeom
edm::ParameterSet parameters
std::pair< int, int > t0sPeakRange
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int superlayer() const
Return the superlayer number (deprecated method name)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::map< int, MonitorElement * > testPulsesTimeBoxes
int sector() const
Definition: DTChamberId.h:61
tuple cout
Definition: gather_cfg.py:121
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::map< int, MonitorElement * > testPulsesProfiles
void DTTestPulsesTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 55 of file DTTestPulsesTask.cc.

References gather_cfg::cout, edm::EventSetup::get(), and cmsHarvester::nevents.

55  {
56 
57  cout<<"[DTTestPulsesTask]: dqmBeginRun"<<endl;
58  // Get the geometry
59  context.get<MuonGeometryRecord>().get(muonGeom);
60  nevents = 0;
61 }
edm::ESHandle< DTGeometry > muonGeom
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

edm::EDGetTokenT<DTDigiCollection> DTTestPulsesTask::dtDigisToken_
private

Definition at line 74 of file DTTestPulsesTask.h.

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

Definition at line 71 of file DTTestPulsesTask.h.

int DTTestPulsesTask::nevents
private

Definition at line 67 of file DTTestPulsesTask.h.

edm::ParameterSet DTTestPulsesTask::parameters
private
edm::ESHandle<DTRangeT0> DTTestPulsesTask::t0RangeMap
private

Definition at line 72 of file DTTestPulsesTask.h.

std::pair<int, int> DTTestPulsesTask::t0sPeakRange
private

Definition at line 75 of file DTTestPulsesTask.h.

std::map<int, MonitorElement*> DTTestPulsesTask::testPulsesOccupancies
private

Definition at line 79 of file DTTestPulsesTask.h.

std::map<int, MonitorElement*> DTTestPulsesTask::testPulsesProfiles
private

Definition at line 78 of file DTTestPulsesTask.h.

std::map<int, MonitorElement*> DTTestPulsesTask::testPulsesTimeBoxes
private

Definition at line 80 of file DTTestPulsesTask.h.