CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::SecSourceAnalyzer Class Reference

#include <SecSourceAnalyzer.h>

Inheritance diagram for edm::SecSourceAnalyzer:
edm::EDAnalyzer

Public Types

typedef
PileUp::EventPrincipalVector 
EventPrincipalVector
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 

Public Member Functions

virtual void getBranches (EventPrincipal *ep)
 
virtual void Loop (const EventPrincipalVector &vec)
 
 SecSourceAnalyzer (const edm::ParameterSet &)
 
 ~SecSourceAnalyzer ()
 
- 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_
 
boost::shared_ptr< PileUpinput_
 
edm::InputTag label_
 
int maxBunch_
 
int minBunch_
 
std::vector< EventPrincipalVectorpileup_ [5]
 
InputTag tag_
 
std::vector< float > TrueNumInteractions_ [5]
 
std::vector< std::vector
< edm::EventID > > 
vectorEventIDs_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 42 of file SecSourceAnalyzer.h.

Member Typedef Documentation

Definition at line 45 of file SecSourceAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file SecSourceAnalyzer.cc.

References dataStep2_, edm::ParameterSet::getParameter(), diJetCalib::histoFileName, input_, label_, maxBunch_, minBunch_, and Playback_cff::playback.

52 :minBunch_(0),
53  maxBunch_(0),
54  tag_(InputTag())
55 {
56  int minb = minBunch_;
57  int maxb = maxBunch_;
58  int averageNumber = 1;
59  std::string histoFileName = " ";
60  TH1F * histoName = new TH1F("h","",10,0,10);
61  bool playback = false;
62 
63  input_.reset(new edm::PileUp(iConfig.getParameter<edm::ParameterSet>("input"),minb,maxb,averageNumber,histoName,playback));
64 
65  dataStep2_ = iConfig.getParameter<bool>("dataStep2");
66 
67 
68  if (dataStep2_)
69  // The data file contain the PCrossingFrame<SimTrack>
70  label_ = iConfig.getParameter<edm::InputTag>("collPCF");
71  else
72  // The data file contain the SimTrack
73  label_ = iConfig.getParameter<edm::InputTag>("collSimTrack");
74 
75 }
T getParameter(std::string const &) const
tuple histoFileName
Definition: diJetCalib.py:108
boost::shared_ptr< PileUp > input_
tuple playback
Definition: Playback_cff.py:20
SecSourceAnalyzer::~SecSourceAnalyzer ( )

Definition at line 78 of file SecSourceAnalyzer.cc.

79 {
80 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 89 of file SecSourceAnalyzer.cc.

References gather_cfg::cout, input_, Loop(), maxBunch_, minBunch_, pileup_, TrueNumInteractions_, and vectorEventIDs_.

90 {
91 
92 
94 
96 
97  std::cout << "-> The std::vector<EventPrincipalVector> of the secondary source 'input' has been filled with "
98  << pileup_[0].size() << " element corresponding to " << maxBunch_-minBunch_+1
99  << " bunch." << std::endl;
100 
101  // Run for one source (input) and the bunch 0
102  Loop(pileup_[0][0]);
103 }
std::vector< EventPrincipalVector > pileup_[5]
std::vector< std::vector< edm::EventID > > vectorEventIDs_
virtual void Loop(const EventPrincipalVector &vec)
boost::shared_ptr< PileUp > input_
std::vector< float > TrueNumInteractions_[5]
tuple cout
Definition: gather_cfg.py:41
void SecSourceAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 161 of file SecSourceAnalyzer.cc.

162 {
163 }
void SecSourceAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 167 of file SecSourceAnalyzer.cc.

References input_.

167  {
168  if (input_) input_->endJob();
169 }
boost::shared_ptr< PileUp > input_
void SecSourceAnalyzer::getBranches ( EventPrincipal ep)
virtual

Definition at line 120 of file SecSourceAnalyzer.cc.

References gather_cfg::cout, dataStep2_, label_, edm::Principal::size(), and tag_.

Referenced by Loop().

121  {
122  std::cout << "-> dataStep2_ = " << dataStep2_ << std::endl;
123  tag_ = InputTag(label_);
124 
125  std::cout << "-> Will try to get the branch with the tag : " << tag_ << std::endl;
126  std::cout << " and the EventPrincipal ep with a size = " << ep->size() << std::endl;
127 
128  if (!dataStep2_){
129  // Get the SimTrack collection
130 
131  // default version changed to transmit vertexoffset
132  boost::shared_ptr<Wrapper<std::vector<SimTrack> > const> shPtr =
133  getProductByTag<std::vector<SimTrack> >(*ep, tag_);
134 
135  if (shPtr)
136  std::cout << "-> Could get SimTrack !" << std::endl;
137  else
138  std::cout << "-> Could not get SimTrack !" << std::endl;
139 
140  }
141  else{
142  // Get the PCrossingFrame collection given as signal
143 
144  // default version changed to transmit vertexoffset
145  tag_ = InputTag("CFwriter","g4SimHits");
146  boost::shared_ptr<Wrapper<PCrossingFrame<SimTrack> > const> shPtr =
147  getProductByTag<PCrossingFrame<SimTrack> >(*ep, tag_);
148 
149  if (shPtr)
150  std::cout << "-> Could get PCrossingFrame<SimTrack> !" << std::endl;
151  else
152  std::cout << "-> Could not get PCrossingFrame<SimTrack> !" << std::endl;
153 
154  }
155 
156  }
tuple cout
Definition: gather_cfg.py:41
void SecSourceAnalyzer::Loop ( const EventPrincipalVector vec)
virtual

Definition at line 106 of file SecSourceAnalyzer.cc.

References gather_cfg::cout, and getBranches().

Referenced by analyze().

106  {
107  //
108  // loop over events
109  //
110  std::cout <<"-> Loop over EventPrincipalVector wich size is "<< vec.size() << "." << std::endl;
111 
112  for (EventPrincipalVector::const_iterator it = vec.begin(); it != vec.end(); ++it) {
113  std::cout <<"-> Get the event: id " << (*it)->id() << std::endl;
114 
115  getBranches(&(**it));
116  }
117 }
virtual void getBranches(EventPrincipal *ep)
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

bool edm::SecSourceAnalyzer::dataStep2_
private

Definition at line 63 of file SecSourceAnalyzer.h.

Referenced by getBranches(), and SecSourceAnalyzer().

boost::shared_ptr<PileUp> edm::SecSourceAnalyzer::input_
private

Definition at line 68 of file SecSourceAnalyzer.h.

Referenced by analyze(), endJob(), and SecSourceAnalyzer().

edm::InputTag edm::SecSourceAnalyzer::label_
private
int edm::SecSourceAnalyzer::maxBunch_
private

Definition at line 61 of file SecSourceAnalyzer.h.

Referenced by analyze(), and SecSourceAnalyzer().

int edm::SecSourceAnalyzer::minBunch_
private

Definition at line 60 of file SecSourceAnalyzer.h.

Referenced by analyze(), and SecSourceAnalyzer().

std::vector<EventPrincipalVector> edm::SecSourceAnalyzer::pileup_[5]
private

Definition at line 70 of file SecSourceAnalyzer.h.

Referenced by analyze().

InputTag edm::SecSourceAnalyzer::tag_
private

Definition at line 73 of file SecSourceAnalyzer.h.

Referenced by getBranches().

std::vector< float > edm::SecSourceAnalyzer::TrueNumInteractions_[5]
private

Definition at line 71 of file SecSourceAnalyzer.h.

Referenced by analyze().

std::vector<std::vector<edm::EventID> > edm::SecSourceAnalyzer::vectorEventIDs_
private

Definition at line 66 of file SecSourceAnalyzer.h.

Referenced by analyze().