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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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::EDGetTokenT
< PCrossingFrame< SimTrack > > 
labelPCF_
 
edm::EDGetTokenT
< SimTrackContainer
labelSimTr_
 

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 35 of file InputAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 47 of file InputAnalyzer.cc.

References dataStep2_, edm::ParameterSet::getParameter(), labelPCF_, and labelSimTr_.

48 {
49 
50  dataStep2_ = iConfig.getParameter<bool>("dataStep2");
51 
52  labelPCF_ = consumes<PCrossingFrame<SimTrack>>(iConfig.getParameter<edm::InputTag>("collPCF"));
53 
54  //will only be needed if not Step2:
55  labelSimTr_ = consumes<SimTrackContainer>(iConfig.getParameter<edm::InputTag>("collSimTrack"));
56 }
T getParameter(std::string const &) const
edm::EDGetTokenT< SimTrackContainer > labelSimTr_
Definition: InputAnalyzer.h:50
edm::EDGetTokenT< PCrossingFrame< SimTrack > > labelPCF_
Definition: InputAnalyzer.h:49
InputAnalyzer::~InputAnalyzer ( )

Definition at line 59 of file InputAnalyzer.cc.

60 {
61 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 70 of file InputAnalyzer.cc.

References gather_cfg::cout, dataStep2_, edm::Event::getByToken(), i, labelPCF_, and labelSimTr_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 124 of file InputAnalyzer.cc.

125 {
126 }
void InputAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file InputAnalyzer.cc.

130  {
131 }

Member Data Documentation

bool edm::InputAnalyzer::dataStep2_
private

Definition at line 48 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

edm::EDGetTokenT<PCrossingFrame<SimTrack> > edm::InputAnalyzer::labelPCF_
private

Definition at line 49 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

edm::EDGetTokenT<SimTrackContainer> edm::InputAnalyzer::labelSimTr_
private

Definition at line 50 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().