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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual 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...
 
virtual ~DTPreCalibrationTask ()
 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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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 ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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)
 
- 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)
 

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 34 of file DTPreCalibrationTask.cc.

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

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

Destructor.

Definition at line 51 of file DTPreCalibrationTask.cc.

51 {}

Member Function Documentation

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

Definition at line 70 of file DTPreCalibrationTask.cc.

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

70  {
71 
72  // Get the digis from the event
74  event.getByToken(digiLabel, dtdigis);
75 
76  // LOOP OVER ALL THE DIGIS OF THE EVENT
78  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
79  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
80  digiIt!=((*dtLayerId_It).second).second; ++digiIt){
81 
82  //Fill the Time Boxes
83  int tdcTime = (*digiIt).countsTDC();
84  TimeBoxes[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
85  (*dtLayerId_It).first.superlayerId().chamberId().sector())]->Fill(tdcTime);
86 
87  //Fill the occupancy plot
88  const DTLayerId dtLId = (*dtLayerId_It).first;
89  int yBin = (dtLId.station()-1)*12+dtLId.layer()+4*(dtLId.superlayer()-1);
90  if(dtLId.station()==4 && dtLId.superlayer()==3)
91  yBin = (dtLId.station()-1)*12+dtLId.layer()+4*(dtLId.superlayer()-2);
92  if((*dtLayerId_It).first.superlayerId().chamberId().sector()<13)
93  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
94  (*dtLayerId_It).first.superlayerId().chamberId().sector())]->Fill((*digiIt).wire(),yBin);
95  else{
96  if(dtLId.superlayer()!=3) yBin = 44 + dtLId.layer();
97  else yBin = 48 + dtLId.layer();
98  if((*dtLayerId_It).first.superlayerId().chamberId().sector()==13)
99  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),4)]->Fill((*digiIt).wire(),yBin);
100  if((*dtLayerId_It).first.superlayerId().chamberId().sector()==14)
101  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),10)]->Fill((*digiIt).wire(),yBin);
102  }
103 
104  }
105  }
106 
107 }
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< DTDigi >::const_iterator const_iterator
int station() const
Return the station number.
Definition: DTChamberId.h:51
std::map< std::pair< int, int >, MonitorElement * > OccupancyHistos
yBin
Definition: cuy.py:891
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
void DTPreCalibrationTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 54 of file DTPreCalibrationTask.cc.

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

55  {
56 
57  for(int wheel=-2; wheel<=2; wheel++){
58  for(int sector=1; sector<=14; sector++){
59  LogTrace("DTPreCalibSummary") <<"[DTPrecalibrationTask]: Book histos for wheel "<<wheel<<", sector "<<sector<<endl;
60  iBooker.setCurrentFolder(folderName+"/TimeBoxes");
61  bookTimeBoxes(iBooker, wheel, sector);
62  iBooker.setCurrentFolder(folderName+"/OccupancyHistos");
63  if(sector<13) bookOccupancyPlot(iBooker, wheel, sector);
64  }
65  }
66 
67 }
void bookTimeBoxes(DQMStore::IBooker &, int wheel, int sector)
Book histos.
void bookOccupancyPlot(DQMStore::IBooker &, int wheel, int sector)
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
void DTPreCalibrationTask::bookOccupancyPlot ( DQMStore::IBooker iBooker,
int  wheel,
int  sector 
)

Definition at line 122 of file DTPreCalibrationTask.cc.

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

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

Book histos.

Definition at line 109 of file DTPreCalibrationTask.cc.

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

109  {
110 
111  stringstream wh; wh << wheel;
112  stringstream sec; sec << sector;
113 
114  // book the time boxes
115  TimeBoxes[make_pair(wheel, sector)]= iBooker.book1D("TimeBox_W"+wh.str()+"_Sec"+sec.str(), "Time Box W"+wh.str()+"_Sec"+sec.str(),(maxTriggerWidth-minTriggerWidth)/50, minTriggerWidth, maxTriggerWidth);
116  TimeBoxes[make_pair(wheel, sector)]->setAxisTitle("TDC counts");
117 
118 }
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes

Member Data Documentation

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

Definition at line 48 of file DTPreCalibrationTask.h.

std::string DTPreCalibrationTask::folderName
private

Definition at line 51 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::maxTriggerWidth
private

Definition at line 50 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::minTriggerWidth
private

Definition at line 49 of file DTPreCalibrationTask.h.

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

Definition at line 57 of file DTPreCalibrationTask.h.

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

Definition at line 54 of file DTPreCalibrationTask.h.