CMS 3D CMS Logo

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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 InputAnalyzer (const edm::ParameterSet &)
 
 ~InputAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

bool dataStep2_
 
edm::EDGetTokenT< PCrossingFrame< SimTrack > > labelPCF_
 
edm::EDGetTokenT< SimTrackContainerlabelSimTr_
 

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

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:49
edm::EDGetTokenT< PCrossingFrame< SimTrack > > labelPCF_
Definition: InputAnalyzer.h:48
InputAnalyzer::~InputAnalyzer ( )
override

Definition at line 59 of file InputAnalyzer.cc.

60 {
61 }

Member Function Documentation

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

Definition at line 70 of file InputAnalyzer.cc.

References gather_cfg::cout, dataStep2_, edm::Event::getByToken(), mps_fire::i, labelPCF_, labelSimTr_, simTrackMatching_cfi::simTrack, and tkConvValidator_cfi::simTracks.

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 }
edm::EDGetTokenT< SimTrackContainer > labelSimTr_
Definition: InputAnalyzer.h:49
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
simTrack
per collection params
edm::EDGetTokenT< PCrossingFrame< SimTrack > > labelPCF_
Definition: InputAnalyzer.h:48
void InputAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 124 of file InputAnalyzer.cc.

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

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 130 of file InputAnalyzer.cc.

130  {
131 }

Member Data Documentation

bool edm::InputAnalyzer::dataStep2_
private

Definition at line 47 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

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

Definition at line 48 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

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

Definition at line 49 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().