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 edm::EDConsumerBase

Public Member Functions

void analyze (const Event &event, const EventSetup &eventSetup) override
 
 DTDigiReader (const ParameterSet &pset)
 
virtual ~DTDigiReader ()
 
- 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::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

Analyse the the muon-drift-tubes digitizer.

Authors
: R. Bellan

Definition at line 28 of file DTDigiReader.cc.

Constructor & Destructor Documentation

DTDigiReader::DTDigiReader ( const ParameterSet pset)
inlineexplicit

Definition at line 31 of file DTDigiReader.cc.

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

31  {
32  file = new TFile("DTDigiPlots.root","RECREATE");
33  file->cd();
34  DigiTimeBox = new TH1F("DigiTimeBox","Digi Time Box",2048,0,1600);
35  DigiTimeBoxW0 = new TH1F("DigiTimeBoxW0","Digi Time Box W0",2000,0,1600);
36  DigiTimeBoxW1 = new TH1F("DigiTimeBoxW1","Digi Time Box W1",2000,0,1600);
37  DigiTimeBoxW2 = new TH1F("DigiTimeBoxW2","Digi Time Box W2",2000,0,1600);
38  if(file->IsOpen()) cout<<"file open!"<<endl;
39  else cout<<"*** Error in opening file ***"<<endl;
40  label = pset.getUntrackedParameter<string>("label");
41  }
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 43 of file DTDigiReader.cc.

References mergeVDriftHistosByStation::file.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 54 of file DTDigiReader.cc.

References funct::abs(), gather_cfg::cout, diffTwoXMLs::label, and trackerHits::simHits.

54  {
55  cout << "--- Run: " << event.id().run()
56  << " Event: " << event.id().event() << endl;
57 
59  event.getByLabel(label, dtDigis);
60  // event.getByLabel("MuonDTDigis", dtDigis);
62  event.getByLabel("g4SimHits","MuonDTHits",simHits);
63 
64 
66  for (detUnitIt=dtDigis->begin();
67  detUnitIt!=dtDigis->end();
68  ++detUnitIt){
69 
70  const DTLayerId& id = (*detUnitIt).first;
71  const DTDigiCollection::Range& range = (*detUnitIt).second;
72 
73  // DTLayerId print-out
74  cout<<"--------------"<<endl;
75  cout<<"id: "<<id;
76 
77  // Loop over the digis of this DetUnit
78  for (DTDigiCollection::const_iterator digiIt = range.first;
79  digiIt!=range.second;
80  ++digiIt){
81  // if((*digiIt).time()<703 &&(*digiIt).time()>699) {
82  cout<<" Wire: "<<(*digiIt).wire()<<endl
83  <<" digi time (ns): "<<(*digiIt).time()<<endl;
84 
85  for(vector<PSimHit>::const_iterator simHit = simHits->begin();
86  simHit != simHits->end(); simHit++){
87  DTWireId wireId((*simHit).detUnitId());
88  if (wireId.layerId()==id && abs((*simHit).particleType())==13){
89  cout<<"entry: "<<(*simHit).entryPoint()<<endl
90  <<"exit: "<<(*simHit).exitPoint()<<endl
91  <<"TOF: "<<(*simHit).timeOfFlight()<<endl;
92  }
93  }
94 
95  // }
96 
97  if(id.layer()==3)
98  DigiTimeBoxW0->Fill((*digiIt).time());
99  else if(abs(id.superlayer())==1)
100  DigiTimeBoxW1->Fill((*digiIt).time());
101  else if(abs(id.superlayer())==2)
102  DigiTimeBoxW2->Fill((*digiIt).time());
103  else cout<<"Error"<<endl;
104  DigiTimeBox->Fill((*digiIt).time());
105 
106  }// for digis in layer
107  }// for layers
108  cout<<"--------------"<<endl;
109  }
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBox
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< DTDigi >::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 113 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW0
private

Definition at line 114 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW1
private

Definition at line 115 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW2
private

Definition at line 116 of file DTDigiReader.cc.

TFile* DTDigiReader::file
private

Definition at line 117 of file DTDigiReader.cc.

string DTDigiReader::label
private