CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTPreCalibrationTask Class Reference

#include <DTPreCalibrationTask.h>

Inheritance diagram for DTPreCalibrationTask:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookOccupancyPlot (DQMStore::IBooker &, int wheel, int sector)
 
void bookTimeBoxes (DQMStore::IBooker &, int wheel, int sector)
 Book histos. More...
 
 DTPreCalibrationTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTPreCalibrationTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::EDGetTokenT< DTDigiCollectiondigiLabel
 
std::string folderName
 
int maxTriggerWidth
 
int minTriggerWidth
 
std::map< std::pair< int, int >, MonitorElement * > OccupancyHistos
 
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Analysis on DT digis (TB + occupancy) before the calibration step

Author
G. Mila - INFN Torino

Definition at line 27 of file DTPreCalibrationTask.h.

Constructor & Destructor Documentation

◆ DTPreCalibrationTask()

DTPreCalibrationTask::DTPreCalibrationTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file DTPreCalibrationTask.cc.

29  {
30  LogTrace("DTPreCalibSummary") << "[DTPrecalibrationTask]: Constructor" << endl;
31 
32  // Label to retrieve DT digis from the event
33  digiLabel = consumes<DTDigiCollection>(ps.getUntrackedParameter<string>("digiLabel"));
34 
35  // parameter for Time Boxes booking
36  minTriggerWidth = ps.getUntrackedParameter<int>("minTriggerWidth", 2000);
37  maxTriggerWidth = ps.getUntrackedParameter<int>("maxTriggerWidth", 6000);
38 
39  // get the histo folder name
40  folderName = ps.getUntrackedParameter<string>("folderName");
41 }

References DataMixerDataOnData_cff::digiLabel, ALCARECODTCalibSynchCosmicsDQM_cff::folderName, edm::ParameterSet::getUntrackedParameter(), LogTrace, ALCARECODTCalibrationDQM_cfi::maxTriggerWidth, and ALCARECODTCalibrationDQM_cfi::minTriggerWidth.

◆ ~DTPreCalibrationTask()

DTPreCalibrationTask::~DTPreCalibrationTask ( )
override

Destructor.

Definition at line 43 of file DTPreCalibrationTask.cc.

43 {}

Member Function Documentation

◆ analyze()

void DTPreCalibrationTask::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 59 of file DTPreCalibrationTask.cc.

59  {
60  // Get the digis from the event
62  event.getByToken(digiLabel, dtdigis);
63 
64  // LOOP OVER ALL THE DIGIS OF THE EVENT
66  for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
67  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
68  digiIt != ((*dtLayerId_It).second).second;
69  ++digiIt) {
70  // Fill the Time Boxes
71  int tdcTime = (*digiIt).countsTDC();
72  TimeBoxes[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
73  (*dtLayerId_It).first.superlayerId().chamberId().sector())]
74  ->Fill(tdcTime);
75 
76  // Fill the occupancy plot
77  const DTLayerId dtLId = (*dtLayerId_It).first;
78  int yBin = (dtLId.station() - 1) * 12 + dtLId.layer() + 4 * (dtLId.superlayer() - 1);
79  if (dtLId.station() == 4 && dtLId.superlayer() == 3)
80  yBin = (dtLId.station() - 1) * 12 + dtLId.layer() + 4 * (dtLId.superlayer() - 2);
81  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() < 13)
82  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
83  (*dtLayerId_It).first.superlayerId().chamberId().sector())]
84  ->Fill((*digiIt).wire(), yBin);
85  else {
86  if (dtLId.superlayer() != 3)
87  yBin = 44 + dtLId.layer();
88  else
89  yBin = 48 + dtLId.layer();
90  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() == 13)
91  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(), 4)]->Fill(
92  (*digiIt).wire(), yBin);
93  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() == 14)
94  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(), 10)]->Fill(
95  (*digiIt).wire(), yBin);
96  }
97  }
98  }
99 }

References DataMixerDataOnData_cff::digiLabel, HcalObjRepresent::Fill(), DTLayerId::layer(), edm::second(), DTChamberId::station(), DTSuperLayerId::superlayer(), and photonAnalyzer_cfi::yBin.

◆ bookHistograms()

void DTPreCalibrationTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 45 of file DTPreCalibrationTask.cc.

45  {
46  for (int wheel = -2; wheel <= 2; wheel++) {
47  for (int sector = 1; sector <= 14; sector++) {
48  LogTrace("DTPreCalibSummary") << "[DTPrecalibrationTask]: Book histos for wheel " << wheel << ", sector "
49  << sector << endl;
50  iBooker.setCurrentFolder(folderName + "/TimeBoxes");
51  bookTimeBoxes(iBooker, wheel, sector);
52  iBooker.setCurrentFolder(folderName + "/OccupancyHistos");
53  if (sector < 13)
54  bookOccupancyPlot(iBooker, wheel, sector);
55  }
56  }
57 }

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, LogTrace, dqm::implementation::NavigatorBase::setCurrentFolder(), and makeMuonMisalignmentScenario::wheel.

◆ bookOccupancyPlot()

void DTPreCalibrationTask::bookOccupancyPlot ( DQMStore::IBooker iBooker,
int  wheel,
int  sector 
)

Definition at line 116 of file DTPreCalibrationTask.cc.

116  {
117  stringstream wh;
118  wh << wheel;
119  stringstream sec;
120  sec << sector;
121 
122  // book the occpancy plot
123  if (sector == 4 || sector == 10)
124  OccupancyHistos[make_pair(wheel, sector)] = iBooker.book2D("Occupancy_W" + wh.str() + "_Sec" + sec.str(),
125  "Occupancy W" + wh.str() + "_Sec" + sec.str(),
126  100,
127  1,
128  100,
129  52,
130  1,
131  53);
132  else
133  OccupancyHistos[make_pair(wheel, sector)] = iBooker.book2D("Occupancy_W" + wh.str() + "_Sec" + sec.str(),
134  "Occupancy W" + wh.str() + "_Sec" + sec.str(),
135  100,
136  1,
137  100,
138  44,
139  1,
140  45);
141  OccupancyHistos[make_pair(wheel, sector)]->setAxisTitle("wire number", 1);
142  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(1, "M1L1", 2);
143  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(2, "M1L2", 2);
144  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(3, "M1L3", 2);
145  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(4, "M1L4", 2);
146  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(5, "M1L5", 2);
147  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(6, "M1L6", 2);
148  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(7, "M1L7", 2);
149  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(8, "M1L8", 2);
150  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(9, "M1L9", 2);
151  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(10, "M1L10", 2);
152  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(11, "M1L11", 2);
153  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(12, "M1L12", 2);
154  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(13, "M2L1", 2);
155  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(14, "M2L2", 2);
156  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(15, "M2L3", 2);
157  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(16, "M2L4", 2);
158  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(17, "M2L5", 2);
159  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(18, "M2L6", 2);
160  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(19, "M2L7", 2);
161  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(20, "M2L8", 2);
162  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(21, "M2L9", 2);
163  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(22, "M2L10", 2);
164  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(23, "M2L11", 2);
165  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(24, "M2L12", 2);
166  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(25, "M3L1", 2);
167  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(26, "M3L2", 2);
168  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(27, "M3L3", 2);
169  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(28, "M3L4", 2);
170  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(29, "M3L5", 2);
171  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(30, "M3L6", 2);
172  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(31, "M3L7", 2);
173  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(32, "M3L8", 2);
174  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(33, "M3L9", 2);
175  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(34, "M3L10", 2);
176  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(35, "M3L11", 2);
177  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(36, "M3L12", 2);
178  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(37, "M4L1", 2);
179  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(38, "M4L2", 2);
180  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(39, "M4L3", 2);
181  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(40, "M4L4", 2);
182  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(41, "M4L5", 2);
183  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(42, "M4L6", 2);
184  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(43, "M4L7", 2);
185  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(44, "M4L8", 2);
186  if (sector == 4) {
187  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(45, "M4Sec13L1", 2);
188  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(46, "M4Sec13L2", 2);
189  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(47, "M4Sec13L3", 2);
190  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(48, "M4Sec13L4", 2);
191  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(49, "M4Sec13L5", 2);
192  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(50, "M4Sec13L6", 2);
193  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(51, "M4Sec13L7", 2);
194  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(52, "M4Sec13L8", 2);
195  }
196  if (sector == 10) {
197  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(45, "M4Sec14L1", 2);
198  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(46, "M4Sec14L2", 2);
199  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(47, "M4Sec14L3", 2);
200  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(48, "M4Sec14L4", 2);
201  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(49, "M4Sec14L5", 2);
202  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(50, "M4Sec14L6", 2);
203  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(51, "M4Sec14L7", 2);
204  OccupancyHistos[make_pair(wheel, sector)]->setBinLabel(52, "M4Sec14L8", 2);
205  }
206 }

References dqm::implementation::IBooker::book2D(), fileinputsource_cfi::sec, dqm::impl::MonitorElement::setAxisTitle(), and makeMuonMisalignmentScenario::wheel.

◆ bookTimeBoxes()

void DTPreCalibrationTask::bookTimeBoxes ( DQMStore::IBooker iBooker,
int  wheel,
int  sector 
)

Book histos.

Definition at line 101 of file DTPreCalibrationTask.cc.

101  {
102  stringstream wh;
103  wh << wheel;
104  stringstream sec;
105  sec << sector;
106 
107  // book the time boxes
108  TimeBoxes[make_pair(wheel, sector)] = iBooker.book1D("TimeBox_W" + wh.str() + "_Sec" + sec.str(),
109  "Time Box W" + wh.str() + "_Sec" + sec.str(),
113  TimeBoxes[make_pair(wheel, sector)]->setAxisTitle("TDC counts");
114 }

References dqm::implementation::IBooker::book1D(), ALCARECODTCalibrationDQM_cfi::maxTriggerWidth, ALCARECODTCalibrationDQM_cfi::minTriggerWidth, fileinputsource_cfi::sec, dqm::impl::MonitorElement::setAxisTitle(), and makeMuonMisalignmentScenario::wheel.

Member Data Documentation

◆ digiLabel

edm::EDGetTokenT<DTDigiCollection> DTPreCalibrationTask::digiLabel
private

Definition at line 43 of file DTPreCalibrationTask.h.

◆ folderName

std::string DTPreCalibrationTask::folderName
private

Definition at line 46 of file DTPreCalibrationTask.h.

◆ maxTriggerWidth

int DTPreCalibrationTask::maxTriggerWidth
private

Definition at line 45 of file DTPreCalibrationTask.h.

◆ minTriggerWidth

int DTPreCalibrationTask::minTriggerWidth
private

Definition at line 44 of file DTPreCalibrationTask.h.

◆ OccupancyHistos

std::map<std::pair<int, int>, MonitorElement *> DTPreCalibrationTask::OccupancyHistos
private

Definition at line 52 of file DTPreCalibrationTask.h.

◆ TimeBoxes

std::map<std::pair<int, int>, MonitorElement *> DTPreCalibrationTask::TimeBoxes
private

Definition at line 49 of file DTPreCalibrationTask.h.

DTPreCalibrationTask::maxTriggerWidth
int maxTriggerWidth
Definition: DTPreCalibrationTask.h:45
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
photonAnalyzer_cfi.yBin
yBin
Definition: photonAnalyzer_cfi.py:85
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
edm::Handle< DTDigiCollection >
DTPreCalibrationTask::TimeBoxes
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
Definition: DTPreCalibrationTask.h:49
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
DTLayerId
Definition: DTLayerId.h:12
DTPreCalibrationTask::digiLabel
edm::EDGetTokenT< DTDigiCollection > digiLabel
Definition: DTPreCalibrationTask.h:43
DTPreCalibrationTask::bookOccupancyPlot
void bookOccupancyPlot(DQMStore::IBooker &, int wheel, int sector)
Definition: DTPreCalibrationTask.cc:116
DTPreCalibrationTask::folderName
std::string folderName
Definition: DTPreCalibrationTask.h:46
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTPreCalibrationTask::bookTimeBoxes
void bookTimeBoxes(DQMStore::IBooker &, int wheel, int sector)
Book histos.
Definition: DTPreCalibrationTask.cc:101
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
DTPreCalibrationTask::minTriggerWidth
int minTriggerWidth
Definition: DTPreCalibrationTask.h:44
DTPreCalibrationTask::OccupancyHistos
std::map< std::pair< int, int >, MonitorElement * > OccupancyHistos
Definition: DTPreCalibrationTask.h:52
dqm::implementation::IBooker::book2D
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:177
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
DigiContainerIterator
Definition: MuonDigiCollection.h:30
DTLayerId::layer
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98