25 using namespace pftools;
29 debug_(0), nParticleWrites_(0), nParticleFails_(0), nEventWrites_(0), nEventFails_(0),
30 deltaRCandToSim_(0.4) {
32 std::cout << __PRETTY_FUNCTION__ << std::endl;
37 tree_->Branch(
"Calibratable",
"pftools::Calibratable", &calib_, 32000, 2);
79 std::cout <<
"\tStarting event..."<< std::endl;
86 if (sims.size() == 0) {
87 std::cout <<
"\tNo sim particles found!" << std::endl;
94 std::cout <<
"\tFound "<< primarySims.size()
95 <<
" primary sim particles, "<< (**pfCandidates_).size() <<
" pfCandidates\n";
97 for (std::vector<unsigned>::const_iterator cit = primarySims.begin(); cit
98 != primarySims.end(); ++cit) {
101 std::cout <<
"\t**Starting particle...**\n";
123 std::cout <<
"\t\tFound candidates near sim, found "
124 << matchingCands.size()<<
" of them.\n";
125 if (matchingCands.size() == 0)
127 for (std::vector<unsigned>::const_iterator mcIt = matchingCands.begin(); mcIt
128 != matchingCands.end(); ++mcIt) {
150 const std::vector<PFSimParticle>& sims) {
151 std::vector<unsigned> answers;
153 for (std::vector<PFSimParticle>::const_iterator cit = sims.begin(); cit
154 != sims.end(); ++cit) {
160 if (particleId != 211)
165 answers.push_back(index);
173 std::cout <<
"\tCandidate: "<< cand <<
"\n";
180 cw.
eta_ = cand.eta();
181 cw.
phi_ = cand.phi();
182 cw.
type_ = cand.particleId();
186 std::cout <<
"\t\tECAL energy = " << cand.ecalEnergy()
187 <<
", HCAL energy = " << cand.hcalEnergy() <<
"\n";
192 std::cout <<
"\tLooping over elements in blocks, "
193 << eleInBlocks.size() <<
" of them."<< std::endl;
194 for (PFCandidate::ElementsInBlocks::iterator bit = eleInBlocks.begin(); bit
195 != eleInBlocks.end(); ++bit) {
204 unsigned indexInBlock((*bit).second);
210 switch (elements[indexInBlock].
type()) {
213 const PFCluster theRealCluster = *clusterRef;
218 std::cout <<
"\t\tECAL cluster: "<< theRealCluster <<
"\n";
225 const PFCluster theRealCluster = *clusterRef;
230 std::cout <<
"\t\tHCAL cluster: "<< theRealCluster <<
"\n";
238 << elements[indexInBlock].type() <<
"\n";
248 const PFSimParticle& pft,
const std::vector<PFCandidate>& cands,
249 const double& deltaRCut) {
252 std::vector<unsigned> answers;
257 for (std::vector<PFCandidate>::const_iterator cit = cands.begin(); cit
258 != cands.end(); ++cit) {
261 double cEta = cand.
eta();
262 double cPhi = cand.
phi();
264 if (
deltaR(cEta, trEta, cPhi, trPhi) < deltaRCut) {
266 answers.push_back(index);
287 std::cout <<
"\t**Finished particle.**\n";
294 std::cout << __PRETTY_FUNCTION__ << std::endl;
300 std::cout <<
"Leaving "<< __PRETTY_FUNCTION__ <<
"\n";
306 const double& phi1,
const double& phi2) {
307 double deltaEta = fabs(eta1 - eta2);
308 double deltaPhi = fabs(phi1 - phi2);
309 if (deltaPhi >
M_PI) {
312 return sqrt(
pow(deltaEta, 2) +
pow(deltaPhi, 2));
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
const std::vector< int > & daughterIds() const
T getParameter(std::string const &) const
edm::InputTag inputTagClustersHcal_
edm::Service< TFileService > fileservice_
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
std::vector< unsigned > findPrimarySimParticles(const std::vector< reco::PFSimParticle > &sims)
virtual void fillTreeAndReset()
CalibratableTest(const edm::ParameterSet &)
edm::Handle< reco::PFCandidateCollection > * pfCandidates_
unsigned nParticleWrites_
double deltaR(const double &eta1, const double &eta2, const double &phi1, const double &phi2)
std::vector< PFSimParticle > PFSimParticleCollection
collection of PFSimParticle objects
const edm::OwnVector< reco::PFBlockElement > & elements() const
void extractCandidate(const reco::PFCandidate &cand)
pftools::Calibratable * calib_
virtual double eta() const
momentum pseudorapidity
std::vector< ElementInBlock > ElementsInBlocks
edm::Handle< reco::PFSimParticleCollection > * simParticles_
edm::Handle< reco::PFClusterCollection > * clustersEcal_
const REPPoint & positionREP() const
cluster position: rho, eta, phi
void getCollection(edm::Handle< T > &c, const edm::InputTag &tag, const edm::Event &event) const
edm::InputTag inputTagCandidates_
std::vector< unsigned > findCandidatesInDeltaR(const reco::PFSimParticle &pft, const std::vector< reco::PFCandidate > &cands, const double &deltaR)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
true particle for particle flow
double energy() const
cluster energy
edm::InputTag inputTagSimParticles_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
const reco::PFTrajectoryPoint & trajectoryPoint(unsigned index) const
edm::Handle< reco::PFClusterCollection > * clustersHcal_
Particle reconstructed by the particle flow algorithm.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
T * make() const
make new ROOT object
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
unsigned int nTrajectoryPoints() const
edm::InputTag inputTagClustersEcal_
virtual double phi() const
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)