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< 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_, and vectorEventIDs_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 160 of file SecSourceAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file SecSourceAnalyzer.cc.

References input_.

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

Definition at line 119 of file SecSourceAnalyzer.cc.

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

Referenced by Loop().

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

Definition at line 105 of file SecSourceAnalyzer.cc.

References gather_cfg::cout, and getBranches().

Referenced by analyze().

105  {
106  //
107  // loop over events
108  //
109  std::cout <<"-> Loop over EventPrincipalVector wich size is "<< vec.size() << "." << std::endl;
110 
111  for (EventPrincipalVector::const_iterator it = vec.begin(); it != vec.end(); ++it) {
112  std::cout <<"-> Get the event: id " << (*it)->id() << std::endl;
113 
114  getBranches(&(**it));
115  }
116 }
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 72 of file SecSourceAnalyzer.h.

Referenced by getBranches().

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

Definition at line 66 of file SecSourceAnalyzer.h.

Referenced by analyze().