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 Member Functions | Private Attributes
edm::InputAnalyzer Class Reference

#include <InputAnalyzer.h>

Inheritance diagram for edm::InputAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 InputAnalyzer (const edm::ParameterSet &)
 
 ~InputAnalyzer ()
 
- 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 Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

bool dataStep2_
 
edm::InputTag 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

Definition at line 32 of file InputAnalyzer.h.

Constructor & Destructor Documentation

InputAnalyzer::InputAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 49 of file InputAnalyzer.cc.

References dataStep2_, edm::ParameterSet::getParameter(), and label_.

50 {
51 
52  dataStep2_ = iConfig.getParameter<bool>("dataStep2");
53 
54  if (dataStep2_)
55  // The data file contain the PCrossingFrame<SimTrack>
56  label_ = iConfig.getParameter<edm::InputTag>("collPCF");
57  else
58  // The data file contain the SimTrack
59  label_ = iConfig.getParameter<edm::InputTag>("collSimTrack");
60 }
T getParameter(std::string const &) const
edm::InputTag label_
Definition: InputAnalyzer.h:46
InputAnalyzer::~InputAnalyzer ( )

Definition at line 63 of file InputAnalyzer.cc.

64 {
65 }

Member Function Documentation

void InputAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 74 of file InputAnalyzer.cc.

References gather_cfg::cout, dataStep2_, edm::Event::getByLabel(), i, and label_.

75 {
76  std::cout << " dataStep2_ = " << dataStep2_ << std::endl;
77 
78  if (!dataStep2_){
79  // Get the SimTrack collection
80 
81  //double simPt=0;
82  int i=0;
83 
84  // Get the SimTrack collection from the event
86  bool gotTracks = iEvent.getByLabel(label_,simTracks);
87 
88  if (!gotTracks)
89  {
90  std::cout<<"-> Could not read SimTracks !!!!"<<std::endl;
91  }
92  else{
93  std::cout<<"-> Could read SimTracks !!!!"<<std::endl;
94 
95  }
96 
97 
98  // Loop over the tracks
99  SimTrackContainer::const_iterator simTrack;
100  for (simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack){
101  i++;
102 
103  //simPt=(*simTrack).momentum().Pt();
104  //std::cout << " # i = " << i << " simPt = " << simPt << std::endl;
105 
106  }
107 
108 
109  }
110  else{
111  // Get the PCrossingFrame collection given as signal
112 
114  bool gotTracks = iEvent.getByLabel("CFWriter","g4SimHits",cf_simtrack);
115 
116  if (!gotTracks)
117  {
118  std::cout<<"-> Could not read PCrossingFrame<SimTracks> !!!!"<<std::endl;
119  }
120  else
121  std::cout<<"-> Could read PCrossingFrame<SimTracks> !!!!"<<std::endl;
122 
123  }
124 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag label_
Definition: InputAnalyzer.h:46
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple cout
Definition: gather_cfg.py:121
void InputAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 128 of file InputAnalyzer.cc.

129 {
130 }
void InputAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file InputAnalyzer.cc.

134  {
135 }

Member Data Documentation

bool edm::InputAnalyzer::dataStep2_
private

Definition at line 45 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

edm::InputTag edm::InputAnalyzer::label_
private