CMS 3D CMS Logo

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

#include <DTPreCalibrationTask.h>

Inheritance diagram for DTPreCalibrationTask:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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
 

Detailed Description

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

Author
G. Mila - INFN Torino

Definition at line 30 of file DTPreCalibrationTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 30 of file DTPreCalibrationTask.cc.

References CastorSimpleReconstructor_cfi::digiLabel, edm::ParameterSet::getUntrackedParameter(), and LogTrace.

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

Destructor.

Definition at line 44 of file DTPreCalibrationTask.cc.

44 {}

Member Function Documentation

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

Definition at line 60 of file DTPreCalibrationTask.cc.

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

60  {
61  // Get the digis from the event
63  event.getByToken(digiLabel, dtdigis);
64 
65  // LOOP OVER ALL THE DIGIS OF THE EVENT
67  for (dtLayerId_It = dtdigis->begin(); dtLayerId_It != dtdigis->end(); ++dtLayerId_It) {
68  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
69  digiIt != ((*dtLayerId_It).second).second;
70  ++digiIt) {
71  // Fill the Time Boxes
72  int tdcTime = (*digiIt).countsTDC();
73  TimeBoxes[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
74  (*dtLayerId_It).first.superlayerId().chamberId().sector())]
75  ->Fill(tdcTime);
76 
77  // Fill the occupancy plot
78  const DTLayerId dtLId = (*dtLayerId_It).first;
79  int yBin = (dtLId.station() - 1) * 12 + dtLId.layer() + 4 * (dtLId.superlayer() - 1);
80  if (dtLId.station() == 4 && dtLId.superlayer() == 3)
81  yBin = (dtLId.station() - 1) * 12 + dtLId.layer() + 4 * (dtLId.superlayer() - 2);
82  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() < 13)
83  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
84  (*dtLayerId_It).first.superlayerId().chamberId().sector())]
85  ->Fill((*digiIt).wire(), yBin);
86  else {
87  if (dtLId.superlayer() != 3)
88  yBin = 44 + dtLId.layer();
89  else
90  yBin = 48 + dtLId.layer();
91  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() == 13)
92  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(), 4)]->Fill(
93  (*digiIt).wire(), yBin);
94  if ((*dtLayerId_It).first.superlayerId().chamberId().sector() == 14)
95  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(), 10)]->Fill(
96  (*digiIt).wire(), yBin);
97  }
98  }
99  }
100 }
std::map< std::pair< int, int >, MonitorElement * > OccupancyHistos
edm::EDGetTokenT< DTDigiCollection > digiLabel
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
U second(std::pair< T, U > const &p)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int superlayer() const
Return the superlayer number (deprecated method name)
std::vector< DigiType >::const_iterator const_iterator
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
int station() const
Return the station number.
Definition: DTChamberId.h:51
yBin
Definition: cuy.py:893
void DTPreCalibrationTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 46 of file DTPreCalibrationTask.cc.

References LogTrace, DQMStore::IBooker::setCurrentFolder(), and makeMuonMisalignmentScenario::wheel.

46  {
47  for (int wheel = -2; wheel <= 2; wheel++) {
48  for (int sector = 1; sector <= 14; sector++) {
49  LogTrace("DTPreCalibSummary") << "[DTPrecalibrationTask]: Book histos for wheel " << wheel << ", sector "
50  << sector << endl;
51  iBooker.setCurrentFolder(folderName + "/TimeBoxes");
52  bookTimeBoxes(iBooker, wheel, sector);
53  iBooker.setCurrentFolder(folderName + "/OccupancyHistos");
54  if (sector < 13)
55  bookOccupancyPlot(iBooker, wheel, sector);
56  }
57  }
58 }
void bookTimeBoxes(DQMStore::IBooker &, int wheel, int sector)
Book histos.
void bookOccupancyPlot(DQMStore::IBooker &, int wheel, int sector)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
#define LogTrace(id)
void DTPreCalibrationTask::bookOccupancyPlot ( DQMStore::IBooker iBooker,
int  wheel,
int  sector 
)

Definition at line 117 of file DTPreCalibrationTask.cc.

References DQMStore::IBooker::book2D(), MonitorElement::setAxisTitle(), and makeMuonMisalignmentScenario::wheel.

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

Book histos.

Definition at line 102 of file DTPreCalibrationTask.cc.

References DQMStore::IBooker::book1D(), MonitorElement::setAxisTitle(), and makeMuonMisalignmentScenario::wheel.

102  {
103  stringstream wh;
104  wh << wheel;
105  stringstream sec;
106  sec << sector;
107 
108  // book the time boxes
109  TimeBoxes[make_pair(wheel, sector)] = iBooker.book1D("TimeBox_W" + wh.str() + "_Sec" + sec.str(),
110  "Time Box W" + wh.str() + "_Sec" + sec.str(),
114  TimeBoxes[make_pair(wheel, sector)]->setAxisTitle("TDC counts");
115 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes

Member Data Documentation

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

Definition at line 46 of file DTPreCalibrationTask.h.

std::string DTPreCalibrationTask::folderName
private

Definition at line 49 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::maxTriggerWidth
private

Definition at line 48 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::minTriggerWidth
private

Definition at line 47 of file DTPreCalibrationTask.h.

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

Definition at line 55 of file DTPreCalibrationTask.h.

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

Definition at line 52 of file DTPreCalibrationTask.h.