CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTDigiReader Class Reference
Inheritance diagram for DTDigiReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase 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::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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

TH1F * DigiTimeBox
 
TH1F * DigiTimeBoxW0
 
TH1F * DigiTimeBoxW1
 
TH1F * DigiTimeBoxW2
 
edm::EDGetTokenT< DTDigiCollectionDTd_token
 
TFile * file
 
string label
 
edm::EDGetTokenT< PSimHitContainerpsim_token
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::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

Analyse the the muon-drift-tubes digitizer.

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, FrontierConditions_GlobalTag_cff::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  psim_token = consumes<PSimHitContainer>( edm::InputTag("g4SimHits","MuonDTHits") );
44  DTd_token = consumes<DTDigiCollection>( edm::InputTag(label) );
45  }
T getUntrackedParameter(std::string const &, T const &) const
TH1F * DigiTimeBoxW1
TH1F * DigiTimeBox
edm::EDGetTokenT< PSimHitContainer > psim_token
edm::EDGetTokenT< DTDigiCollection > DTd_token
TH1F * DigiTimeBoxW2
TH1F * DigiTimeBoxW0
virtual DTDigiReader::~DTDigiReader ( )
inlinevirtual

Definition at line 47 of file DTDigiReader.cc.

References FrontierConditions_GlobalTag_cff::file.

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

Member Function Documentation

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

Definition at line 58 of file DTDigiReader.cc.

References funct::abs(), gather_cfg::cout, hcalTTPDigis_cfi::id, rpcPointValidation_cfi::simHit, and trackerHits::simHits.

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

Member Data Documentation

TH1F* DTDigiReader::DigiTimeBox
private

Definition at line 117 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW0
private

Definition at line 118 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW1
private

Definition at line 119 of file DTDigiReader.cc.

TH1F* DTDigiReader::DigiTimeBoxW2
private

Definition at line 120 of file DTDigiReader.cc.

edm::EDGetTokenT< DTDigiCollection > DTDigiReader::DTd_token
private

Definition at line 124 of file DTDigiReader.cc.

TFile* DTDigiReader::file
private

Definition at line 121 of file DTDigiReader.cc.

string DTDigiReader::label
private
edm::EDGetTokenT< PSimHitContainer > DTDigiReader::psim_token
private

Definition at line 123 of file DTDigiReader.cc.