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

Public Member Functions

 InputAnalyzer (const edm::ParameterSet &)
 
 ~InputAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
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
 
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

Definition at line 33 of file InputAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 50 of file InputAnalyzer.cc.

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

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

Definition at line 64 of file InputAnalyzer.cc.

65 {
66 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 75 of file InputAnalyzer.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 129 of file InputAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file InputAnalyzer.cc.

135  {
136 }

Member Data Documentation

bool edm::InputAnalyzer::dataStep2_
private

Definition at line 46 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

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