1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: FillerMCParticles.h,v 1.6 2008/07/13 08:42:04 loizides Exp $
|
3 |
//
|
4 |
// FillerMCParticles
|
5 |
//
|
6 |
// Imlementation of a filler to fill HepMC particles (gen) AND TrackingParticles (sim)
|
7 |
// into mithep::MCParticles. Gen and Sim information is thus merged into a single collection
|
8 |
//
|
9 |
// Authors: C.Loizides, J.Bendavid
|
10 |
//--------------------------------------------------------------------------------------------------
|
11 |
|
12 |
#ifndef TREEFILLER_FILLERMCPARTICLES_H
|
13 |
#define TREEFILLER_FILLERMCPARTICLES_H
|
14 |
|
15 |
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
16 |
#include "MitAna/DataUtil/interface/TreeWriter.h"
|
17 |
#include "MitAna/DataTree/interface/Collections.h"
|
18 |
#include "MitProd/TreeFiller/interface/BaseFiller.h"
|
19 |
#include "MitProd/TreeFiller/interface/AssociationMaps.h"
|
20 |
|
21 |
namespace mithep
|
22 |
{
|
23 |
class FillerMCParticles : public BaseFiller
|
24 |
{
|
25 |
public:
|
26 |
FillerMCParticles(const edm::ParameterSet &cfg, const char *name, bool active=1);
|
27 |
~FillerMCParticles();
|
28 |
|
29 |
void BookDataBlock(TreeWriter &tws);
|
30 |
void FillDataBlock(const edm::Event &e, const edm::EventSetup &es);
|
31 |
void ResolveLinks (const edm::Event &e, const edm::EventSetup &es);
|
32 |
const GenParticleMap *GetGenParticleMap() const;
|
33 |
const SimParticleMap *GetSimParticleMap() const;
|
34 |
|
35 |
private:
|
36 |
Bool_t genActive_;
|
37 |
Bool_t simActive_;
|
38 |
std::string genEdmName_;
|
39 |
std::string simEdmName_;
|
40 |
std::string mitName_;
|
41 |
mithep::MCParticleArr *mcParticles_;
|
42 |
mithep::GenParticleMap *genMap_;
|
43 |
mithep::SimParticleMap *simMap_;
|
44 |
};
|
45 |
}
|
46 |
|
47 |
//--------------------------------------------------------------------------------------------------
|
48 |
inline const mithep::GenParticleMap *mithep::FillerMCParticles::GetGenParticleMap() const
|
49 |
{
|
50 |
if (genActive_)
|
51 |
return genMap_;
|
52 |
else
|
53 |
return 0;
|
54 |
}
|
55 |
|
56 |
//--------------------------------------------------------------------------------------------------
|
57 |
inline const mithep::SimParticleMap *mithep::FillerMCParticles::GetSimParticleMap() const
|
58 |
{
|
59 |
if (simActive_)
|
60 |
return simMap_;
|
61 |
else
|
62 |
return 0;
|
63 |
}
|
64 |
#endif
|