ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Validation/src/MCParticlesValMod.cc
Revision: 1.3
Committed: Fri Jul 10 14:04:44 2009 UTC (15 years, 9 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_029c, Mit_029b, Mit_029a, Mit_028a, Mit_028, Mit_027, Mit_027a, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, HEAD
Changes since 1.2: +4 -5 lines
Log Message:
Cleanup

File Contents

# Content
1 // $Id: MCParticlesValMod.cc,v 1.2 2009/06/15 15:00:23 loizides Exp $
2
3 #include "MitPhysics/Validation/interface/MCParticlesValMod.h"
4 #include "MitAna/DataTree/interface/MCParticleCol.h"
5 #include "MitAna/DataTree/interface/Names.h"
6 #include <TH1D.h>
7
8 using namespace mithep;
9
10 ClassImp(mithep::MCParticlesValMod)
11
12 //--------------------------------------------------------------------------------------------------
13 MCParticlesValMod::MCParticlesValMod(const char *name, const char *title) :
14 BaseMod(name,title),
15 fPartName(Names::gkMCPartBrn),
16 fParticles(0)
17 {
18 // Constructor.
19 }
20
21 //--------------------------------------------------------------------------------------------------
22 void MCParticlesValMod::Process()
23 {
24 // Process entries of the tree. For this module, we just load
25 // the branch and fill the histograms.
26
27 LoadBranch(GetPartName());
28
29 Int_t ents=fParticles->GetEntries();
30 for(Int_t i=0;i<ents;++i) {
31 const MCParticle *p = fParticles->At(i);
32 fHs[0]->Fill(p->Pt());
33 fHs[1]->Fill(p->Eta());
34 if (p->IsGenerated()) {
35 fHs[2]->Fill(p->Pt());
36 fHs[3]->Fill(p->Eta());
37 }
38 if (p->IsSimulated()) {
39 fHs[4]->Fill(p->Pt());
40 fHs[5]->Fill(p->Eta());
41 }
42
43 Double_t mdiff = (p->Mass() - p->PdgMass()) / (p->PdgMass()+0.01);
44 fHs[6]->Fill(mdiff);
45 if (p->IsGenerated())
46 fHs[7]->Fill(mdiff);
47 if (p->IsSimulated())
48 fHs[8]->Fill(mdiff);
49 if (mdiff>0.01) {
50 cout << "----" << mdiff << "-> " << p->Mass() << " " << p->PdgMass() << ": ";
51 p->Print();
52 fHs[9]->Fill(p->AbsPdgId());
53 }
54 }
55 }
56
57 //--------------------------------------------------------------------------------------------------
58 void MCParticlesValMod::SlaveBegin()
59 {
60 // Run startup code on the computer (slave) doing the actual
61 // analysis. Here, we typically initialize histograms and
62 // other analysis objects and request branches. For this module,
63 // we request a branch of the MitTree.
64
65 ReqBranch(GetPartName(), fParticles);
66
67 AddTH1(fHs[0],"hPtHist",";p_{t} [GeV]; #",100,0.,250.);
68 AddTH1(fHs[1],"hEtaHist",";#eta;#",160,-8.,8.);
69 AddTH1(fHs[2],"hGenPtHist",";p_{t} [GeV];#",100,0.,250.);
70 AddTH1(fHs[3],"hGenEtaHist",";#eta;#",160,-8.,8.);
71 AddTH1(fHs[4],"hSimPtHist",";p_{t} [GeV];#",100,0.,250.);
72 AddTH1(fHs[5],"hSimEtaHist",";#eta;#",160,-8.,8.);
73 AddTH1(fHs[6],"hMassDiff",";#eta;#",1000,-5.,5.);
74 AddTH1(fHs[7],"hGenMassDiff",";#eta;#",1000,-5.,5.);
75 AddTH1(fHs[8],"hSimMassDiff",";#eta;#",1000,-5.,5.);
76 AddTH1(fHs[9],"hDiffPdg",";pdg;#",500,0.5,500.5);
77 }
78
79 //--------------------------------------------------------------------------------------------------
80 void MCParticlesValMod::SlaveTerminate()
81 {
82 // Run finishing code on the computer (slave) that did the
83 // analysis. For this module, we dont do anything here.
84 }