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
DTDigiReader Class Reference
Inheritance diagram for DTDigiReader:
edm::EDAnalyzer

Public Member Functions

void analyze (const Event &event, const EventSetup &eventSetup)
 
 DTDigiReader (const ParameterSet &pset)
 
virtual ~DTDigiReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

TH1F * DigiTimeBox
 
TH1F * DigiTimeBoxW0
 
TH1F * DigiTimeBoxW1
 
TH1F * DigiTimeBoxW2
 
TFile * file
 
string label
 

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
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Analyse the the muon-drift-tubes digitizer.

Date:
2006/08/01 15:24:06
Revision:
1.5
Authors
: R. Bellan

Definition at line 30 of file DTDigiReader.cc.

Constructor & Destructor Documentation

DTDigiReader::DTDigiReader ( const ParameterSet pset)
inlineexplicit

Definition at line 33 of file DTDigiReader.cc.

References gather_cfg::cout, mergeVDriftHistosByStation::file, edm::ParameterSet::getUntrackedParameter(), and diffTwoXMLs::label.

33  {
34  file = new TFile("DTDigiPlots.root","RECREATE");
35  file->cd();
36  DigiTimeBox = new TH1F("DigiTimeBox","Digi Time Box",2048,0,1600);
37  DigiTimeBoxW0 = new TH1F("DigiTimeBoxW0","Digi Time Box W0",2000,0,1600);
38  DigiTimeBoxW1 = new TH1F("DigiTimeBoxW1","Digi Time Box W1",2000,0,1600);
39  DigiTimeBoxW2 = new TH1F("DigiTimeBoxW2","Digi Time Box W2",2000,0,1600);
40  if(file->IsOpen()) cout<<"file open!"<<endl;
41  else cout<<"*** Error in opening file ***"<<endl;
42  label = pset.getUntrackedParameter<string>("label");
43  }
T getUntrackedParameter(std::string const &, T const &) const
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBox
tuple cout
Definition: gather_cfg.py:121
TH1F * DigiTimeBoxW2
TH1F * DigiTimeBoxW0
virtual DTDigiReader::~DTDigiReader ( )
inlinevirtual

Definition at line 45 of file DTDigiReader.cc.

References mergeVDriftHistosByStation::file.

45  {
46  file->cd();
47  DigiTimeBox->Write();
48  DigiTimeBoxW0->Write();
49  DigiTimeBoxW1->Write();
50  DigiTimeBoxW2->Write();
51  file->Close();
52  // delete file;
53  // delete DigiTimeBox;
54  }
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBox
TH1F * DigiTimeBoxW2
TH1F * DigiTimeBoxW0

Member Function Documentation

void DTDigiReader::analyze ( const Event event,
const EventSetup eventSetup 
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 56 of file DTDigiReader.cc.

References abs, gather_cfg::cout, errorMatrix2Lands_multiChannel::id, diffTwoXMLs::label, and trackerHits::simHits.

56  {
57  cout << "--- Run: " << event.id().run()
58  << " Event: " << event.id().event() << endl;
59 
61  event.getByLabel(label, dtDigis);
62  // event.getByLabel("MuonDTDigis", dtDigis);
64  event.getByLabel("g4SimHits","MuonDTHits",simHits);
65 
66 
68  for (detUnitIt=dtDigis->begin();
69  detUnitIt!=dtDigis->end();
70  ++detUnitIt){
71 
72  const DTLayerId& id = (*detUnitIt).first;
73  const DTDigiCollection::Range& range = (*detUnitIt).second;
74 
75  // DTLayerId print-out
76  cout<<"--------------"<<endl;
77  cout<<"id: "<<id;
78 
79  // Loop over the digis of this DetUnit
80  for (DTDigiCollection::const_iterator digiIt = range.first;
81  digiIt!=range.second;
82  ++digiIt){
83  // if((*digiIt).time()<703 &&(*digiIt).time()>699) {
84  cout<<" Wire: "<<(*digiIt).wire()<<endl
85  <<" digi time (ns): "<<(*digiIt).time()<<endl;
86 
87  for(vector<PSimHit>::const_iterator simHit = simHits->begin();
88  simHit != simHits->end(); simHit++){
89  DTWireId wireId((*simHit).detUnitId());
90  if (wireId.layerId()==id && abs((*simHit).particleType())==13){
91  cout<<"entry: "<<(*simHit).entryPoint()<<endl
92  <<"exit: "<<(*simHit).exitPoint()<<endl
93  <<"TOF: "<<(*simHit).timeOfFlight()<<endl;
94  }
95  }
96 
97  // }
98 
99  if(id.layer()==3)
100  DigiTimeBoxW0->Fill((*digiIt).time());
101  else if(abs(id.superlayer())==1)
102  DigiTimeBoxW1->Fill((*digiIt).time());
103  else if(abs(id.superlayer())==2)
104  DigiTimeBoxW2->Fill((*digiIt).time());
105  else cout<<"Error"<<endl;
106  DigiTimeBox->Fill((*digiIt).time());
107 
108  }// for digis in layer
109  }// for layers
110  cout<<"--------------"<<endl;
111  }
#define abs(x)
Definition: mlp_lapack.h:159
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBox
std::vector< DigiType >::const_iterator const_iterator
tuple simHits
Definition: trackerHits.py:16
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:121
TH1F * DigiTimeBoxW2
TH1F * DigiTimeBoxW0

Member Data Documentation

TH1F* DTDigiReader::DigiTimeBox
private

Definition at line 115 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW0
private

Definition at line 116 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW1
private

Definition at line 117 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW2
private

Definition at line 118 of file DTDigiReader.cc.

TFile* DTDigiReader::file
private

Definition at line 119 of file DTDigiReader.cc.

string DTDigiReader::label
private