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 Types | Private Attributes
MuonDTDigis Class Reference

#include <MuonDTDigis.h>

Inheritance diagram for MuonDTDigis:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 MuonDTDigis (const edm::ParameterSet &pset)
 
virtual ~MuonDTDigis ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
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 &event, const edm::EventSetup &eventSetup)
 
hDigis * WheelHistos (int wheel)
 
- 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 Types

typedef std::map< DTWireId,
std::vector< const PSimHit * > > 
DTWireIdMap
 

Private Attributes

DQMStoredbe_
 
edm::EDGetTokenT
< DTDigiCollection
DigiToken_
 
hHits * hAllHits
 
hDigis * hDigis_global
 
hDigis * hDigis_W0
 
hDigis * hDigis_W1
 
hDigis * hDigis_W2
 
TH1F * hMuonDigis
 
MonitorElementmeDigiEfficiency_
 
MonitorElementmeDigiEfficiencyMu_
 
MonitorElementmeDigiHisto_
 
MonitorElementmeDigiTimeBox_
 
std::vector< MonitorElement * > meDigiTimeBox_SL_
 
MonitorElementmeDigiTimeBox_wheel0_
 
MonitorElementmeDigiTimeBox_wheel1m_
 
MonitorElementmeDigiTimeBox_wheel1p_
 
MonitorElementmeDigiTimeBox_wheel2m_
 
MonitorElementmeDigiTimeBox_wheel2p_
 
MonitorElementmeDoubleDigi_
 
MonitorElementmeMB1_digi_occup_
 
MonitorElementmeMB1_sim_occup_
 
MonitorElementmeMB2_digi_occup_
 
MonitorElementmeMB2_sim_occup_
 
MonitorElementmeMB3_digi_occup_
 
MonitorElementmeMB3_sim_occup_
 
MonitorElementmeMB4_digi_occup_
 
MonitorElementmeMB4_sim_occup_
 
MonitorElementmeSimvsDigi_
 
MonitorElementmeWire_DoubleDigi_
 
std::string outputFile_
 
edm::EDGetTokenT
< edm::PSimHitContainer
SimHitToken_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Analyse the the muon-drift-tubes digitizer.

Authors
: R. Bellan

Definition at line 48 of file MuonDTDigis.h.

Member Typedef Documentation

typedef std::map<DTWireId, std::vector<const PSimHit*> > MuonDTDigis::DTWireIdMap
private

Definition at line 71 of file MuonDTDigis.h.

Constructor & Destructor Documentation

MuonDTDigis::MuonDTDigis ( const edm::ParameterSet pset)
explicit

Definition at line 19 of file MuonDTDigis.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), DQMStore::showDirStructure(), and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20 
21  // ----------------------
22  // Get the debug parameter for verbose output
23  verbose_ = pset.getUntrackedParameter<bool>("verbose",false);
24 
25  // the name of the Digi collection
26  SimHitToken_ = consumes<edm::PSimHitContainer>(pset.getParameter<edm::InputTag>("SimHitLabel"));
27 
28  // the name of the Digi collection
29  DigiToken_ = consumes<DTDigiCollection> (pset.getParameter<edm::InputTag>(("DigiLabel")));
30 
31  // ----------------------
32  // DQM ROOT output
33  outputFile_ = pset.getUntrackedParameter<std::string>("outputFile", "");
34  if ( outputFile_.size() != 0 ) {
35  LogInfo("OutputInfo") << " DT Muon Digis Task histograms will be saved to '"
36  << outputFile_.c_str() << "'";
37  } else {
38  LogInfo("OutputInfo") << " DT Muon Digis Task histograms will NOT be saved";
39  }
40 
41  string::size_type loc = outputFile_.find( ".root", 0 );
42  std::string outputFile_more_plots_;
43  if( loc != string::npos ) {
44  outputFile_more_plots_ = outputFile_.substr(0,loc)+"_more_plots.root";
45  } else {
46  outputFile_more_plots_ = " DTDigis_more_plots.root";
47  }
48 
49  // Please, uncomment next lines if you want a secong root file with additional histos
50 
51  // file_more_plots = new TFile(outputFile_more_plots_.c_str(),"RECREATE");
52  // file_more_plots->cd();
53  // if(file_more_plots->IsOpen()) cout<<"File for additional plots: " << outputFile_more_plots_ << " open!"<<endl;
54  // else cout<<"*** Error in opening file for additional plots ***"<<endl;
55 
56  hDigis_global = new hDigis("Global");
57  hDigis_W0 = new hDigis("Wheel0");
58  hDigis_W1 = new hDigis("Wheel1");
59  hDigis_W2 = new hDigis("Wheel2");
60  hAllHits = new hHits("AllHits");
61 
62  // End of comment . See more in Destructor (~MuonDTDigis) method
63 
64 
65 
66  // ----------------------
67  // get hold of back-end interface
68  dbe_ = 0;
70  if ( dbe_ ) {
71  if ( verbose_ ) {
72  dbe_->setVerbose(1);
73  } else {
74  dbe_->setVerbose(0);
75  }
76  }
77  if ( dbe_ ) {
78  if ( verbose_ ) dbe_->showDirStructure();
79  }
80 
81  // ----------------------
82 
83  meDigiTimeBox_ = 0;
91  meDoubleDigi_ = 0;
92  meSimvsDigi_ = 0;
94 
95  meMB1_sim_occup_ = 0;
97  meMB2_sim_occup_ = 0;
99  meMB3_sim_occup_ = 0;
100  meMB3_digi_occup_ = 0;
101  meMB4_sim_occup_ = 0;
102  meMB4_digi_occup_ = 0;
103 
104  //meDigiTimeBox_SL_ = 0;
105  meDigiHisto_ = 0;
106 
107 
108  // ----------------------
109  // We go
110  // ----------------------
111 
112  Char_t histo_n[100];
113  Char_t histo_t[100];
114 
115  if ( dbe_ ) {
116  dbe_->setCurrentFolder("MuonDTDigisV/DTDigiValidationTask");
117 
118  sprintf (histo_n, "DigiTimeBox" );
119  sprintf (histo_t, "Digi Time Box" );
120  meDigiTimeBox_ = dbe_->book1D(histo_n, histo_t, 1536,0,1200);
121 
122  sprintf (histo_n, "DigiTimeBox_wheel2m" );
123  sprintf (histo_t, "Digi Time Box wheel -2" );
124  meDigiTimeBox_wheel2m_ = dbe_->book1D(histo_n, histo_t, 384,0,1200);
125 
126  sprintf (histo_n, "DigiTimeBox_wheel1m" );
127  sprintf (histo_t, "Digi Time Box wheel -1" );
128  meDigiTimeBox_wheel1m_ = dbe_->book1D(histo_n, histo_t, 384,0,1200);
129 
130  sprintf (histo_n, "DigiTimeBox_wheel0" );
131  sprintf (histo_t, "Digi Time Box wheel 0" );
132  meDigiTimeBox_wheel0_ = dbe_->book1D(histo_n, histo_t, 384,0,1200);
133 
134  sprintf (histo_n, "DigiTimeBox_wheel1p" );
135  sprintf (histo_t, "Digi Time Box wheel 1" );
136  meDigiTimeBox_wheel1p_ = dbe_->book1D(histo_n, histo_t, 384,0,1200);
137 
138  sprintf (histo_n, "DigiTimeBox_wheel2p" );
139  sprintf (histo_t, "Digi Time Box wheel 2" );
140  meDigiTimeBox_wheel2p_ = dbe_->book1D(histo_n, histo_t, 384,0,1200);
141 
142  sprintf (histo_n, "DigiEfficiencyMu" );
143  sprintf (histo_t, "Ratio (#Digis Mu)/(#SimHits Mu)" );
144  meDigiEfficiencyMu_ = dbe_->book1D(histo_n, histo_t, 100, 0., 5.);
145 
146  sprintf (histo_n, "DigiEfficiency" );
147  sprintf (histo_t, "Ratio (#Digis)/(#SimHits)" );
148  meDigiEfficiency_ = dbe_->book1D(histo_n, histo_t, 100, 0., 5.);
149 
150  sprintf (histo_n, "Number_Digi_per_layer" );
151  sprintf (histo_t, "Number_Digi_per_layer" );
152  meDoubleDigi_ = dbe_->book1D(histo_n, histo_t, 10,0.,10.);
153 
154  sprintf (histo_n, "Number_simhit_vs_digi" );
155  sprintf (histo_t, "Number_simhit_vs_digi" );
156  meSimvsDigi_ = dbe_->book2D(histo_n, histo_t, 100, 0., 140., 100, 0., 140.);
157 
158  sprintf (histo_n, "Wire_Number_with_double_Digi" );
159  sprintf (histo_t, "Wire_Number_with_double_Digi" );
160  meWire_DoubleDigi_ = dbe_->book1D(histo_n, histo_t, 100,0.,100.);
161 
162  sprintf (histo_n, "Simhit_occupancy_MB1" );
163  sprintf (histo_t, "Simhit_occupancy_MB1" );
164  meMB1_sim_occup_ = dbe_->book1D(histo_n, histo_t, 55, 0., 55. );
165 
166  sprintf (histo_n, "Digi_occupancy_MB1" );
167  sprintf (histo_t, "Digi_occupancy_MB1" );
168  meMB1_digi_occup_ = dbe_->book1D(histo_n, histo_t, 55, 0., 55. );
169 
170  sprintf (histo_n, "Simhit_occupancy_MB2" );
171  sprintf (histo_t, "Simhit_occupancy_MB2" );
172  meMB2_sim_occup_ = dbe_->book1D(histo_n, histo_t, 63, 0., 63. );
173 
174  sprintf (histo_n, "Digi_occupancy_MB2" );
175  sprintf (histo_t, "Digi_occupancy_MB2" );
176  meMB2_digi_occup_ = dbe_->book1D(histo_n, histo_t, 63, 0., 63. );
177 
178  sprintf (histo_n, "Simhit_occupancy_MB3" );
179  sprintf (histo_t, "Simhit_occupancy_MB3" );
180  meMB3_sim_occup_ = dbe_->book1D(histo_n, histo_t, 75, 0., 75. );
181 
182  sprintf (histo_n, "Digi_occupancy_MB3" );
183  sprintf (histo_t, "Digi_occupancy_MB3" );
184  meMB3_digi_occup_ = dbe_->book1D(histo_n, histo_t, 75, 0., 75. );
185 
186  sprintf (histo_n, "Simhit_occupancy_MB4" );
187  sprintf (histo_t, "Simhit_occupancy_MB4" );
188  meMB4_sim_occup_ = dbe_->book1D(histo_n, histo_t, 99, 0., 99. );
189 
190  sprintf (histo_n, "Digi_occupancy_MB4" );
191  sprintf (histo_t, "Digi_occupancy_MB4" );
192  meMB4_digi_occup_ = dbe_->book1D(histo_n, histo_t, 99, 0., 99. );
193 
194  // sprintf (histo_n, "" );
195  // sprintf (histo_t, "" );
196 
197  /*
198  // Other option
199  string histoTag = "DigiTimeBox_slid_";
200  for ( int wheel = -2; wheel <= +2; ++wheel ) {
201  for ( int station = 1; station <= 4; ++station ) {
202  for ( int superLayer = 1; superLayer <= 3; ++superLayer ) {
203  string histoName = histoTag
204  + "_W" + wheel.str()
205  + "_St" + station.str()
206  + "_SL" + superLayer.str();
207  // the booking is not yet done
208  }
209  }
210  }
211  */
212  // Begona's option
213  char stringcham[40];
214  for ( int slnum = 1; slnum < 62; ++slnum ) {
215  sprintf(stringcham, "DigiTimeBox_slid_%d", slnum) ;
216  meDigiHisto_ = dbe_->book1D(stringcham, stringcham, 100,0,1200);
217  meDigiTimeBox_SL_.push_back(meDigiHisto_);
218  }
219  }
220 
221 }
MonitorElement * meDoubleDigi_
Definition: MuonDTDigis.h:92
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meWire_DoubleDigi_
Definition: MuonDTDigis.h:94
std::vector< MonitorElement * > meDigiTimeBox_SL_
Definition: MuonDTDigis.h:105
MonitorElement * meDigiHisto_
Definition: MuonDTDigis.h:106
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
hHits * hAllHits
Definition: MuonDTDigis.h:116
MonitorElement * meMB2_digi_occup_
Definition: MuonDTDigis.h:99
edm::EDGetTokenT< DTDigiCollection > DigiToken_
Definition: MuonDTDigis.h:74
MonitorElement * meMB3_sim_occup_
Definition: MuonDTDigis.h:100
uint16_t size_type
MonitorElement * meDigiEfficiencyMu_
Definition: MuonDTDigis.h:91
MonitorElement * meDigiTimeBox_wheel2m_
Definition: MuonDTDigis.h:85
MonitorElement * meDigiTimeBox_wheel1m_
Definition: MuonDTDigis.h:86
MonitorElement * meDigiTimeBox_wheel0_
Definition: MuonDTDigis.h:87
std::string outputFile_
Definition: MuonDTDigis.h:75
edm::EDGetTokenT< edm::PSimHitContainer > SimHitToken_
Definition: MuonDTDigis.h:73
MonitorElement * meMB4_sim_occup_
Definition: MuonDTDigis.h:102
MonitorElement * meMB1_sim_occup_
Definition: MuonDTDigis.h:96
MonitorElement * meMB2_sim_occup_
Definition: MuonDTDigis.h:98
MonitorElement * meMB3_digi_occup_
Definition: MuonDTDigis.h:101
MonitorElement * meDigiTimeBox_
Definition: MuonDTDigis.h:84
MonitorElement * meDigiTimeBox_wheel1p_
Definition: MuonDTDigis.h:88
MonitorElement * meMB4_digi_occup_
Definition: MuonDTDigis.h:103
void setVerbose(unsigned level)
Definition: DQMStore.cc:631
MonitorElement * meSimvsDigi_
Definition: MuonDTDigis.h:93
hDigis * hDigis_W2
Definition: MuonDTDigis.h:115
MonitorElement * meDigiEfficiency_
Definition: MuonDTDigis.h:90
DQMStore * dbe_
Definition: MuonDTDigis.h:81
hDigis * hDigis_global
Definition: MuonDTDigis.h:112
bool verbose_
Definition: MuonDTDigis.h:78
MonitorElement * meDigiTimeBox_wheel2p_
Definition: MuonDTDigis.h:89
void showDirStructure(void) const
Definition: DQMStore.cc:3332
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:1082
MonitorElement * meMB1_digi_occup_
Definition: MuonDTDigis.h:97
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
hDigis * hDigis_W1
Definition: MuonDTDigis.h:114
hDigis * hDigis_W0
Definition: MuonDTDigis.h:113
MuonDTDigis::~MuonDTDigis ( )
virtual

Definition at line 223 of file MuonDTDigis.cc.

References gather_cfg::cout, dbe_, and DQMStore::save().

223  {
224 
225  // Uncomment these next lines if you want additional plots in a second .root file
226 
227  // file_more_plots->cd();
228 
229  // hDigis_global->Write();
230 
231  // hDigis_W0->Write();
232  // hDigis_W1->Write();
233  // hDigis_W2->Write();
234  // hAllHits->Write();
235 
236  // file_more_plots->Close();
237 
238  // End of comment.
239 
240  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
241 
242  if(verbose_)
243  cout << "[MuonDTDigis] Destructor called" << endl;
244 
245 }
std::string outputFile_
Definition: MuonDTDigis.h:75
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
DQMStore * dbe_
Definition: MuonDTDigis.h:81
tuple cout
Definition: gather_cfg.py:121
bool verbose_
Definition: MuonDTDigis.h:78

Member Function Documentation

void MuonDTDigis::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 251 of file MuonDTDigis.cc.

References funct::abs(), begin, gather_cfg::cout, HcalObjRepresent::Fill(), edm::EventSetup::get(), M_PI, mag(), RPCpg::mu, cmsHarvester::path, trackerHits::simHits, relativeConstraints::station, theta(), x, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

251  {
252 
253  if(verbose_)
254  cout << "--- [MuonDTDigis] Analysing Event: #Run: " << event.id().run()
255  << " #Event: " << event.id().event() << endl;
256 
257  // Get the DT Geometry
258  ESHandle<DTGeometry> muonGeom;
259  eventSetup.get<MuonGeometryRecord>().get(muonGeom);
260 
261  // Get the Digi collection from the event
262  Handle<DTDigiCollection> dtDigis;
263  event.getByToken(DigiToken_, dtDigis);
264 
265  // Get simhits
267  event.getByToken(SimHitToken_, simHits);
268 
269 
270  int num_mudigis;
271  int num_musimhits;
272  int num_digis;
273  int num_digis_layer;
274  int cham_num ;
275  int wire_touched;
276  num_digis = 0;
277  num_mudigis = 0;
278  num_musimhits = 0;
279  DTWireIdMap wireMap;
280 
281  for(vector<PSimHit>::const_iterator hit = simHits->begin();
282  hit != simHits->end(); hit++){
283  // Create the id of the wire, the simHits in the DT known also the wireId
284  DTWireId wireId(hit->detUnitId());
285  // cout << " PSimHits wire id " << wireId << " part type " << hit->particleType() << endl;
286 
287  // Fill the map
288  wireMap[wireId].push_back(&(*hit));
289 
290  LocalPoint entryP = hit->entryPoint();
291  LocalPoint exitP = hit->exitPoint();
292  int partType = hit->particleType();
293  if ( abs(partType) == 13 ) num_musimhits++;
294 
295  if ( wireId.station() == 1 && abs(partType) == 13 ) meMB1_sim_occup_->Fill(wireId.wire());
296  if ( wireId.station() == 2 && abs(partType) == 13 ) meMB2_sim_occup_->Fill(wireId.wire());
297  if ( wireId.station() == 3 && abs(partType) == 13 ) meMB3_sim_occup_->Fill(wireId.wire());
298  if ( wireId.station() == 4 && abs(partType) == 13 ) meMB4_sim_occup_->Fill(wireId.wire());
299 
300 
301  float path = (exitP-entryP).mag();
302  float path_x = fabs((exitP-entryP).x());
303 
304  hAllHits->Fill(entryP.x(),exitP.x(),
305  entryP.y(),exitP.y(),
306  entryP.z(),exitP.z(),
307  path , path_x,
308  partType, hit->processType(),
309  hit->pabs());
310 
311  }
312 
313  // cout << "num muon simhits " << num_musimhits << endl;
314 
316  for (detUnitIt=dtDigis->begin();
317  detUnitIt!=dtDigis->end();
318  ++detUnitIt){
319 
320  const DTLayerId& id = (*detUnitIt).first;
321  const DTDigiCollection::Range& range = (*detUnitIt).second;
322 
323  num_digis_layer = 0 ;
324  cham_num = 0 ;
325  wire_touched = 0;
326 
327  // Loop over the digis of this DetUnit
328  for (DTDigiCollection::const_iterator digiIt = range.first;
329  digiIt!=range.second;
330  ++digiIt){
331  // cout<<" Wire: "<<(*digiIt).wire()<<endl
332  // <<" digi time (ns): "<<(*digiIt).time()<<endl;
333 
334  num_digis++;
335  num_digis_layer++;
336  if (num_digis_layer > 1 )
337  {
338  if ( (*digiIt).wire() == wire_touched )
339  {
340  meWire_DoubleDigi_->Fill((*digiIt).wire());
341  // cout << "old & new wire " << wire_touched << " " << (*digiIt).wire() << endl;
342  }
343  }
344  wire_touched = (*digiIt).wire();
345 
346  meDigiTimeBox_->Fill((*digiIt).time());
347  if (id.wheel() == -2 ) meDigiTimeBox_wheel2m_->Fill((*digiIt).time());
348  if (id.wheel() == -1 ) meDigiTimeBox_wheel1m_->Fill((*digiIt).time());
349  if (id.wheel() == 0 ) meDigiTimeBox_wheel0_ ->Fill((*digiIt).time());
350  if (id.wheel() == 1 ) meDigiTimeBox_wheel1p_->Fill((*digiIt).time());
351  if (id.wheel() == 2 ) meDigiTimeBox_wheel2p_->Fill((*digiIt).time());
352 
353  // Superlayer number and fill histo with digi timebox
354 
355  cham_num = (id.wheel() +2)*12 + (id.station() -1)*3 + id.superlayer();
356  // cout << " Histo number " << cham_num << endl;
357 
358  meDigiTimeBox_SL_[cham_num]->Fill((*digiIt).time());
359 
360  // cout << " size de digis " << (*digiIt).size() << endl;
361 
362  DTWireId wireId(id,(*digiIt).wire());
363  if (wireId.station() == 1 ) meMB1_digi_occup_->Fill((*digiIt).wire());
364  if (wireId.station() == 2 ) meMB2_digi_occup_->Fill((*digiIt).wire());
365  if (wireId.station() == 3 ) meMB3_digi_occup_->Fill((*digiIt).wire());
366  if (wireId.station() == 4 ) meMB4_digi_occup_->Fill((*digiIt).wire());
367 
368  int mu=0;
369  float theta = 0;
370 
371  for(vector<const PSimHit*>::iterator hit = wireMap[wireId].begin();
372  hit != wireMap[wireId].end(); hit++)
373  if( abs((*hit)->particleType()) == 13){
374  theta = atan( (*hit)->momentumAtEntry().x()/ (-(*hit)->momentumAtEntry().z()) )*180/M_PI;
375  // cout<<"momentum x: "<<(*hit)->momentumAtEntry().x()<<endl
376  // <<"momentum z: "<<(*hit)->momentumAtEntry().z()<<endl
377  // <<"atan: "<<theta<<endl;
378  mu++;
379  }
380 
381  if( mu ) num_mudigis++;
382 
383  if(mu && theta){
384  hDigis_global->Fill((*digiIt).time(),theta,id.superlayer());
385  //filling digi histos for wheel and for RZ and RPhi
386  WheelHistos(id.wheel())->Fill((*digiIt).time(),theta,id.superlayer());
387  }
388 
389  }// for digis in layer
390 
391  meDoubleDigi_->Fill( (float)num_digis_layer );
392 
393  }// for layers
394 
395  //cout << "num_digis " << num_digis << "mu digis " << num_mudigis << endl;
396 
397  if (num_musimhits != 0) {
398  meDigiEfficiencyMu_->Fill( (float)num_mudigis/(float)num_musimhits );
399  meDigiEfficiency_->Fill( (float)num_digis/(float)num_musimhits );
400  }
401 
402  meSimvsDigi_->Fill( (float)num_musimhits, (float)num_digis ) ;
403  // cout<<"--------------"<<endl;
404 
405 }
MonitorElement * meDoubleDigi_
Definition: MuonDTDigis.h:92
MonitorElement * meWire_DoubleDigi_
Definition: MuonDTDigis.h:94
std::vector< MonitorElement * > meDigiTimeBox_SL_
Definition: MuonDTDigis.h:105
hHits * hAllHits
Definition: MuonDTDigis.h:116
std::map< DTWireId, std::vector< const PSimHit * > > DTWireIdMap
Definition: MuonDTDigis.h:71
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:63
MonitorElement * meMB2_digi_occup_
Definition: MuonDTDigis.h:99
edm::EDGetTokenT< DTDigiCollection > DigiToken_
Definition: MuonDTDigis.h:74
MonitorElement * meMB3_sim_occup_
Definition: MuonDTDigis.h:100
MonitorElement * meDigiEfficiencyMu_
Definition: MuonDTDigis.h:91
MonitorElement * meDigiTimeBox_wheel2m_
Definition: MuonDTDigis.h:85
void Fill(long long x)
MonitorElement * meDigiTimeBox_wheel1m_
Definition: MuonDTDigis.h:86
MonitorElement * meDigiTimeBox_wheel0_
Definition: MuonDTDigis.h:87
edm::EDGetTokenT< edm::PSimHitContainer > SimHitToken_
Definition: MuonDTDigis.h:73
tuple path
else: Piece not in the list, fine.
MonitorElement * meMB4_sim_occup_
Definition: MuonDTDigis.h:102
MonitorElement * meMB1_sim_occup_
Definition: MuonDTDigis.h:96
MonitorElement * meMB2_sim_occup_
Definition: MuonDTDigis.h:98
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * meMB3_digi_occup_
Definition: MuonDTDigis.h:101
T z() const
Definition: PV3DBase.h:64
MonitorElement * meDigiTimeBox_
Definition: MuonDTDigis.h:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meDigiTimeBox_wheel1p_
Definition: MuonDTDigis.h:88
MonitorElement * meMB4_digi_occup_
Definition: MuonDTDigis.h:103
const int mu
Definition: Constants.h:22
#define M_PI
hDigis * WheelHistos(int wheel)
Definition: MuonDTDigis.cc:407
MonitorElement * meSimvsDigi_
Definition: MuonDTDigis.h:93
const T & get() const
Definition: EventSetup.h:55
std::vector< DTDigi >::const_iterator const_iterator
tuple simHits
Definition: trackerHits.py:16
MonitorElement * meDigiEfficiency_
Definition: MuonDTDigis.h:90
#define begin
Definition: vmac.h:30
hDigis * hDigis_global
Definition: MuonDTDigis.h:112
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:121
bool verbose_
Definition: MuonDTDigis.h:78
MonitorElement * meDigiTimeBox_wheel2p_
Definition: MuonDTDigis.h:89
Definition: DDAxes.h:10
T x() const
Definition: PV3DBase.h:62
MonitorElement * meMB1_digi_occup_
Definition: MuonDTDigis.h:97
hDigis * MuonDTDigis::WheelHistos ( int  wheel)
protected

Definition at line 407 of file MuonDTDigis.cc.

References funct::abs(), and NULL.

407  {
408  switch(abs(wheel)){
409 
410  case 0: return hDigis_W0;
411 
412  case 1: return hDigis_W1;
413 
414  case 2: return hDigis_W2;
415 
416  default: return NULL;
417  }
418 }
#define NULL
Definition: scimark2.h:8
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
hDigis * hDigis_W2
Definition: MuonDTDigis.h:115
hDigis * hDigis_W1
Definition: MuonDTDigis.h:114
hDigis * hDigis_W0
Definition: MuonDTDigis.h:113

Member Data Documentation

DQMStore* MuonDTDigis::dbe_
private

Definition at line 81 of file MuonDTDigis.h.

edm::EDGetTokenT<DTDigiCollection> MuonDTDigis::DigiToken_
private

Definition at line 74 of file MuonDTDigis.h.

hHits* MuonDTDigis::hAllHits
private

Definition at line 116 of file MuonDTDigis.h.

hDigis* MuonDTDigis::hDigis_global
private

Definition at line 112 of file MuonDTDigis.h.

hDigis* MuonDTDigis::hDigis_W0
private

Definition at line 113 of file MuonDTDigis.h.

hDigis* MuonDTDigis::hDigis_W1
private

Definition at line 114 of file MuonDTDigis.h.

hDigis* MuonDTDigis::hDigis_W2
private

Definition at line 115 of file MuonDTDigis.h.

TH1F* MuonDTDigis::hMuonDigis
private

Definition at line 108 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiEfficiency_
private

Definition at line 90 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiEfficiencyMu_
private

Definition at line 91 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiHisto_
private

Definition at line 106 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_
private

Definition at line 84 of file MuonDTDigis.h.

std::vector<MonitorElement*> MuonDTDigis::meDigiTimeBox_SL_
private

Definition at line 105 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_wheel0_
private

Definition at line 87 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_wheel1m_
private

Definition at line 86 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_wheel1p_
private

Definition at line 88 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_wheel2m_
private

Definition at line 85 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDigiTimeBox_wheel2p_
private

Definition at line 89 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meDoubleDigi_
private

Definition at line 92 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB1_digi_occup_
private

Definition at line 97 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB1_sim_occup_
private

Definition at line 96 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB2_digi_occup_
private

Definition at line 99 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB2_sim_occup_
private

Definition at line 98 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB3_digi_occup_
private

Definition at line 101 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB3_sim_occup_
private

Definition at line 100 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB4_digi_occup_
private

Definition at line 103 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meMB4_sim_occup_
private

Definition at line 102 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meSimvsDigi_
private

Definition at line 93 of file MuonDTDigis.h.

MonitorElement* MuonDTDigis::meWire_DoubleDigi_
private

Definition at line 94 of file MuonDTDigis.h.

std::string MuonDTDigis::outputFile_
private

Definition at line 75 of file MuonDTDigis.h.

edm::EDGetTokenT<edm::PSimHitContainer> MuonDTDigis::SimHitToken_
private

Definition at line 73 of file MuonDTDigis.h.

bool MuonDTDigis::verbose_
private

Definition at line 78 of file MuonDTDigis.h.