CMS 3D CMS Logo

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

#include <DTPreCalibrationTask.h>

Inheritance diagram for DTPreCalibrationTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void bookOccupancyPlot (int wheel, int sector)
 
void bookTimeBoxes (int wheel, int sector)
 Book histos. More...
 
 DTPreCalibrationTask (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob ()
 EndJob. More...
 
virtual ~DTPreCalibrationTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

DQMStoredbe
 
std::string digiLabel
 
std::string folderName
 
int maxTriggerWidth
 
int minTriggerWidth
 
std::map< std::pair< int, int >
, MonitorElement * > 
OccupancyHistos
 
std::string outputFileName
 
bool saveFile
 
std::map< std::pair< int, int >
, MonitorElement * > 
TimeBoxes
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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

Date:
2010/01/07 16:31:59
Revision:
1.4
Author
G. Mila - INFN Torino

Definition at line 31 of file DTPreCalibrationTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 36 of file DTPreCalibrationTask.cc.

References dtTPAnalyzer_cfg::digiLabel, edm::ParameterSet::getUntrackedParameter(), LogTrace, cppFunctionSkipper::operator, and dumpDBToFile_GT_ttrig_cfg::outputFileName.

36  {
37 
38  LogTrace("DTPreCalibSummary") <<"[DTPrecalibrationTask]: Constructor"<<endl;
39 
41 
42  // Label to retrieve DT digis from the event
43  digiLabel = ps.getUntrackedParameter<string>("digiLabel");
44 
45  // parameter for Time Boxes booking
46  minTriggerWidth = ps.getUntrackedParameter<int>("minTriggerWidth",2000);
47  maxTriggerWidth = ps.getUntrackedParameter<int>("maxTriggerWidth",6000);
48 
49  // histo saving on file
50  saveFile = ps.getUntrackedParameter<bool>("SaveFile",false);
51  // output file name
52  outputFileName = ps.getUntrackedParameter<string>("outputFileName");
53  // get the histo folder name
54  folderName = ps.getUntrackedParameter<string>("folderName");
55 
56 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTPreCalibrationTask::~DTPreCalibrationTask ( )
virtual

Destructor.

Definition at line 59 of file DTPreCalibrationTask.cc.

59 {}

Member Function Documentation

void DTPreCalibrationTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 77 of file DTPreCalibrationTask.cc.

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

77  {
78 
79  // Get the digis from the event
81  event.getByLabel(digiLabel, dtdigis);
82 
83  // LOOP OVER ALL THE DIGIS OF THE EVENT
85  for (dtLayerId_It=dtdigis->begin(); dtLayerId_It!=dtdigis->end(); ++dtLayerId_It){
86  for (DTDigiCollection::const_iterator digiIt = ((*dtLayerId_It).second).first;
87  digiIt!=((*dtLayerId_It).second).second; ++digiIt){
88 
89  //Fill the Time Boxes
90  int tdcTime = (*digiIt).countsTDC();
91  TimeBoxes[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
92  (*dtLayerId_It).first.superlayerId().chamberId().sector())]->Fill(tdcTime);
93 
94  //Fill the occupancy plot
95  const DTLayerId dtLId = (*dtLayerId_It).first;
96  int yBin = (dtLId.station()-1)*12+dtLId.layer()+4*(dtLId.superlayer()-1);
97  if(dtLId.station()==4 && dtLId.superlayer()==3)
98  yBin = (dtLId.station()-1)*12+dtLId.layer()+4*(dtLId.superlayer()-2);
99  if((*dtLayerId_It).first.superlayerId().chamberId().sector()<13)
100  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),
101  (*dtLayerId_It).first.superlayerId().chamberId().sector())]->Fill((*digiIt).wire(),yBin);
102  else{
103  if(dtLId.superlayer()!=3) yBin = 44 + dtLId.layer();
104  else yBin = 48 + dtLId.layer();
105  if((*dtLayerId_It).first.superlayerId().chamberId().sector()==13)
106  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),4)]->Fill((*digiIt).wire(),yBin);
107  if((*dtLayerId_It).first.superlayerId().chamberId().sector()==14)
108  OccupancyHistos[make_pair((*dtLayerId_It).first.superlayerId().chamberId().wheel(),10)]->Fill((*digiIt).wire(),yBin);
109  }
110 
111  }
112  }
113 
114 }
tuple yBin
Definition: cuy.py:891
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
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
int station() const
Return the station number.
Definition: DTChamberId.h:53
std::map< std::pair< int, int >, MonitorElement * > OccupancyHistos
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
void DTPreCalibrationTask::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file DTPreCalibrationTask.cc.

References LogTrace.

62  {
63 
64  for(int wheel=-2; wheel<=2; wheel++){
65  for(int sector=1; sector<=14; sector++){
66  LogTrace("DTPreCalibSummary") <<"[DTPrecalibrationTask]: Book histos for wheel "<<wheel<<", sector "<<sector<<endl;
67  dbe->setCurrentFolder(folderName+"/TimeBoxes");
68  bookTimeBoxes(wheel, sector);
69  dbe->setCurrentFolder(folderName+"/OccupancyHistos");
70  if(sector<13) bookOccupancyPlot(wheel, sector);
71  }
72  }
73 
74 }
void bookTimeBoxes(int wheel, int sector)
Book histos.
#define LogTrace(id)
void bookOccupancyPlot(int wheel, int sector)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void DTPreCalibrationTask::bookOccupancyPlot ( int  wheel,
int  sector 
)

Definition at line 139 of file DTPreCalibrationTask.cc.

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

Book histos.

Definition at line 126 of file DTPreCalibrationTask.cc.

126  {
127 
128  stringstream wh; wh << wheel;
129  stringstream sec; sec << sector;
130 
131  // book the time boxes
132  TimeBoxes[make_pair(wheel, sector)]= dbe->book1D("TimeBox_W"+wh.str()+"_Sec"+sec.str(), "Time Box W"+wh.str()+"_Sec"+sec.str(),(maxTriggerWidth-minTriggerWidth)/50, minTriggerWidth, maxTriggerWidth);
133  TimeBoxes[make_pair(wheel, sector)]->setAxisTitle("TDC counts");
134 
135 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
std::map< std::pair< int, int >, MonitorElement * > TimeBoxes
void DTPreCalibrationTask::endJob ( void  )
virtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file DTPreCalibrationTask.cc.

References dumpDBToFile_GT_ttrig_cfg::outputFileName.

117  {
118 
119  // save file for offLine analysis
120  if(saveFile)
122 
123 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118

Member Data Documentation

DQMStore* DTPreCalibrationTask::dbe
private

Definition at line 56 of file DTPreCalibrationTask.h.

std::string DTPreCalibrationTask::digiLabel
private

Definition at line 57 of file DTPreCalibrationTask.h.

std::string DTPreCalibrationTask::folderName
private

Definition at line 62 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::maxTriggerWidth
private

Definition at line 59 of file DTPreCalibrationTask.h.

int DTPreCalibrationTask::minTriggerWidth
private

Definition at line 58 of file DTPreCalibrationTask.h.

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

Definition at line 68 of file DTPreCalibrationTask.h.

std::string DTPreCalibrationTask::outputFileName
private

Definition at line 61 of file DTPreCalibrationTask.h.

bool DTPreCalibrationTask::saveFile
private

Definition at line 60 of file DTPreCalibrationTask.h.

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

Definition at line 65 of file DTPreCalibrationTask.h.