28 for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
29 iParam != parameterNames.end(); iParam++ ){
34 const int kMaxMcTruth = 10000;
35 mcpid =
new int[kMaxMcTruth];
37 mcvx =
new float[kMaxMcTruth];
38 mcvy =
new float[kMaxMcTruth];
39 mcvz =
new float[kMaxMcTruth];
40 mcpt =
new float[kMaxMcTruth];
41 mceta =
new float[kMaxMcTruth];
42 mcphi =
new float[kMaxMcTruth];
45 HltTree->Branch(
"NMCpart",&
nmcpart,
"NMCpart/I");
46 HltTree->Branch(
"MCpid",
mcpid,
"MCpid[NMCpart]/I");
47 HltTree->Branch(
"MCstatus",
mcstatus,
"MCstatus[NMCpart]/I");
48 HltTree->Branch(
"MCvtxX",
mcvx,
"MCvtxX[NMCpart]/F");
49 HltTree->Branch(
"MCvtxY",
mcvy,
"MCvtxY[NMCpart]/F");
50 HltTree->Branch(
"MCvtxZ",
mcvz,
"MCvtxZ[NMCpart]/F");
51 HltTree->Branch(
"MCpt",
mcpt,
"MCpt[NMCpart]/F");
52 HltTree->Branch(
"MCeta",
mceta,
"MCeta[NMCpart]/F");
53 HltTree->Branch(
"MCphi",
mcphi,
"MCphi[NMCpart]/F");
54 HltTree->Branch(
"MCPtHat",&
pthatf,
"MCPtHat/F");
55 HltTree->Branch(
"MCmu3",&
nmu3,
"MCmu3/I");
56 HltTree->Branch(
"MCel3",&
nel3,
"MCel3/I");
57 HltTree->Branch(
"MCbb",&
nbb,
"MCbb/I");
58 HltTree->Branch(
"MCab",&
nab,
"MCab/I");
59 HltTree->Branch(
"MCWenu",&
nwenu,
"MCWenu/I");
60 HltTree->Branch(
"MCWmunu",&
nwmunu,
"MCmunu/I");
61 HltTree->Branch(
"MCZee",&
nzee,
"MCZee/I");
62 HltTree->Branch(
"MCZmumu",&
nzmumu,
"MCZmumu/I");
63 HltTree->Branch(
"MCptEleMax",&
ptEleMax,
"MCptEleMax/F");
64 HltTree->Branch(
"MCptMuMax",&
ptMuMax,
"MCptMuMax/F");
71 const edm::Handle<std::vector<SimTrack> > & simTracks,
72 const edm::Handle<std::vector<SimVertex> > & simVertices,
92 if((simTracks.isValid())&&(simVertices.isValid())){
93 for (
unsigned int j=0;
j<simTracks->size();
j++) {
94 int pdgid = simTracks->at(
j).type();
95 if (
abs(pdgid)!=13)
continue;
96 double pt = simTracks->at(
j).momentum().pt();
98 double eta = simTracks->at(
j).momentum().eta();
99 if (
abs(eta)>2.5)
continue;
100 if (simTracks->at(
j).noVertex())
continue;
101 int vertIndex = simTracks->at(
j).vertIndex();
102 double x = simVertices->at(vertIndex).position().x();
103 double y = simVertices->at(vertIndex).position().y();
104 double r =
sqrt(x*x+y*y);
105 if (r>150.)
continue;
106 double z = simVertices->at(vertIndex).position().z();
107 if (
abs(z)>300.)
continue;
115 for (
size_t i = 0;
i < mctruth->size(); ++
i) {
129 for (
size_t j=0;
j != idg; ++
j){
131 if ((d.
pdgId()==11)||(d.
pdgId()==-11)){wel += 1;}
132 if ((d.
pdgId()==13)||(d.
pdgId()==-13)){wmu += 1;}
137 if (
mcpid[nmc]==23) {
139 for (
size_t j=0;
j != idg; ++
j){
141 if (d.
pdgId()==11){zee += 1;}
142 if (d.
pdgId()==-11){zee += 2;}
143 if (d.
pdgId()==13){zmumu += 1;}
144 if (d.
pdgId()==-13){zmumu += 2;}
151 if (((
mcpid[nmc]==11)||(
mcpid[nmc]==-11))&&(
mcpt[nmc]>2.5)) {el3 += 1;}
153 if (
mcpid[nmc]==-5) {mab += 1;}
154 if (
mcpid[nmc]==5) {mbb += 1;}
174 if((zee%3)==0){
nzee = zee/3;}
176 if ((zmumu%3)==0){
nzmumu = zmumu/3;}
T getParameter(std::string const &) const
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
virtual double vx() const =0
x coordinate of vertex position
virtual double vy() const =0
y coordinate of vertex position
virtual size_type numberOfDaughters() const =0
number of daughters
void analyze(const edm::Handle< reco::CandidateView > &mctruth, const double &pthat, const edm::Handle< std::vector< SimTrack > > &simTracks, const edm::Handle< std::vector< SimVertex > > &simVertices, TTree *tree)
std::vector< std::string > getParameterNames() const
virtual int pdgId() const =0
PDG identifier.
virtual double vz() const =0
z coordinate of vertex position
void setup(const edm::ParameterSet &pSet, TTree *tree)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity