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)
 
 ~DTDigiReader () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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::DTDigiReader ( const ParameterSet pset)
inlineexplicit

Definition at line 32 of file DTDigiReader.cc.

32  {
33  file = new TFile("DTDigiPlots.root", "RECREATE");
34  file->cd();
35  DigiTimeBox = new TH1F("DigiTimeBox", "Digi Time Box", 2048, 0, 1600);
36  DigiTimeBoxW0 = new TH1F("DigiTimeBoxW0", "Digi Time Box W0", 2000, 0, 1600);
37  DigiTimeBoxW1 = new TH1F("DigiTimeBoxW1", "Digi Time Box W1", 2000, 0, 1600);
38  DigiTimeBoxW2 = new TH1F("DigiTimeBoxW2", "Digi Time Box W2", 2000, 0, 1600);
39  if (file->IsOpen())
40  cout << "file open!" << endl;
41  else
42  cout << "*** Error in opening file ***" << endl;
43  label = pset.getUntrackedParameter<string>("label");
44  psim_token = consumes<PSimHitContainer>(edm::InputTag("g4SimHits", "MuonDTHits"));
45  DTd_token = consumes<DTDigiCollection>(edm::InputTag(label));
46  }

References gather_cfg::cout, FrontierConditions_GlobalTag_cff::file, label, and muonDTDigis_cfi::pset.

◆ ~DTDigiReader()

DTDigiReader::~DTDigiReader ( )
inlineoverride

Definition at line 48 of file DTDigiReader.cc.

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

References FrontierConditions_GlobalTag_cff::file.

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 59 of file DTDigiReader.cc.

59  {
60  cout << "--- Run: " << event.id().run() << " Event: " << event.id().event() << endl;
61 
63  event.getByToken(DTd_token, dtDigis);
64  // event.getByLabel("MuonDTDigis", dtDigis);
66  event.getByToken(psim_token, simHits);
67 
69  for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end(); ++detUnitIt) {
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; digiIt != range.second; ++digiIt) {
79  // if((*digiIt).time()<703 &&(*digiIt).time()>699) {
80  cout << " Wire: " << (*digiIt).wire() << endl << " digi time (ns): " << (*digiIt).time() << endl;
81 
82  for (vector<PSimHit>::const_iterator simHit = simHits->begin(); simHit != simHits->end(); simHit++) {
83  DTWireId wireId((*simHit).detUnitId());
84  if (wireId.layerId() == id && abs((*simHit).particleType()) == 13) {
85  cout << "entry: " << (*simHit).entryPoint() << endl
86  << "exit: " << (*simHit).exitPoint() << endl
87  << "TOF: " << (*simHit).timeOfFlight() << endl;
88  }
89  }
90 
91  // }
92 
93  if (id.layer() == 3)
94  DigiTimeBoxW0->Fill((*digiIt).time());
95  else if (abs(id.superlayer()) == 1)
96  DigiTimeBoxW1->Fill((*digiIt).time());
97  else if (abs(id.superlayer()) == 2)
98  DigiTimeBoxW2->Fill((*digiIt).time());
99  else
100  cout << "Error" << endl;
101  DigiTimeBox->Fill((*digiIt).time());
102 
103  } // for digis in layer
104  } // for layers
105  cout << "--------------" << endl;
106  }

References funct::abs(), gather_cfg::cout, triggerObjects_cff::id, phase1PixelTopology::layer, FastTimerService_cff::range, rpcPointValidation_cfi::simHit, and FastTrackerRecHitCombiner_cfi::simHits.

Member Data Documentation

◆ DigiTimeBox

TH1F* DTDigiReader::DigiTimeBox
private

Definition at line 110 of file DTDigiReader.cc.

◆ DigiTimeBoxW0

TH1F* DTDigiReader::DigiTimeBoxW0
private

Definition at line 111 of file DTDigiReader.cc.

◆ DigiTimeBoxW1

TH1F* DTDigiReader::DigiTimeBoxW1
private

Definition at line 112 of file DTDigiReader.cc.

◆ DigiTimeBoxW2

TH1F* DTDigiReader::DigiTimeBoxW2
private

Definition at line 113 of file DTDigiReader.cc.

◆ DTd_token

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

Definition at line 117 of file DTDigiReader.cc.

◆ file

TFile* DTDigiReader::file
private

Definition at line 114 of file DTDigiReader.cc.

◆ label

string DTDigiReader::label
private

Definition at line 109 of file DTDigiReader.cc.

◆ psim_token

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

Definition at line 116 of file DTDigiReader.cc.

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DTDigiReader::DTd_token
edm::EDGetTokenT< DTDigiCollection > DTd_token
Definition: DTDigiReader.cc:117
DTDigiReader::DigiTimeBoxW2
TH1F * DigiTimeBoxW2
Definition: DTDigiReader.cc:113
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
edm::Handle< DTDigiCollection >
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
DTDigiReader::DigiTimeBoxW0
TH1F * DigiTimeBoxW0
Definition: DTDigiReader.cc:111
DTWireId
Definition: DTWireId.h:12
DTDigiReader::file
TFile * file
Definition: DTDigiReader.cc:114
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
DTDigiReader::psim_token
edm::EDGetTokenT< PSimHitContainer > psim_token
Definition: DTDigiReader.cc:116
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTDigiReader::DigiTimeBoxW1
TH1F * DigiTimeBoxW1
Definition: DTDigiReader.cc:112
DTDigiReader::label
string label
Definition: DTDigiReader.cc:109
DTDigiReader::DigiTimeBox
TH1F * DigiTimeBox
Definition: DTDigiReader.cc:110
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27