Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mcchk::GenCheck Class Reference

A module to check the results from the Monte Carlo generator. More...

#include <GenCheck.h>

Inheritance diagram for mcchk::GenCheck:

jobc::Module cfg::Observer List of all members.

Public Member Functions

 GenCheck (const char *version)
 ~GenCheck ()
void Update (const cfg::Config &c)
jobc::Result Ana (const edm::EventHandle &evt)

Private Attributes

TH1F * fGenerated [6]
 Spectra as generated.
TH1F * fPlusFocus [6]
 Spectra for + focus.
TH1F * fMinusFocus [6]
 Spectra for - focus.

Detailed Description

A module to check the results from the Monte Carlo generator.

Definition at line 16 of file GenCheck.h.


Constructor & Destructor Documentation

GenCheck::GenCheck const char *  version  ) 
 

Definition at line 19 of file GenCheck.cxx.

References fGenerated, fMinusFocus, fPlusFocus, and jobc::Module::SetCfgVersion().

00019                                       : 
00020   jobc::Module("mcchk::GenCheck")
00021 {
00022   this->SetCfgVersion(version);
00023 
00024   fGenerated[0] = new TH1F("fGenerated_necc","",  100, 0.0, 20.0);
00025   fGenerated[1] = new TH1F("fGenerated_nebcc","", 100, 0.0, 20.0);
00026   fGenerated[2] = new TH1F("fGenerated_nmcc","",  100, 0.0, 20.0);
00027   fGenerated[3] = new TH1F("fGenerated_nmbcc","", 100, 0.0, 20.0);
00028   fGenerated[4] = new TH1F("fGenerated_nnc","",   100, 0.0, 20.0);
00029   fGenerated[5] = new TH1F("fGenerated_nbnc","",  100, 0.0, 20.0);
00030     
00031   fPlusFocus[0] = new TH1F("fPlusFocus_necc","", 100, 0.0, 20.0);
00032   fPlusFocus[1] = new TH1F("fPlusFocus_nebcc","",100, 0.0, 20.0);
00033   fPlusFocus[2] = new TH1F("fPlusFocus_nmcc","", 100, 0.0, 20.0);
00034   fPlusFocus[3] = new TH1F("fPlusFocus_nmbcc","",100, 0.0, 20.0);
00035   fPlusFocus[4] = new TH1F("fPlusFocus_nnc","",  100, 0.0, 20.0);
00036   fPlusFocus[5] = new TH1F("fPlusFocus_nbnc","", 100, 0.0, 20.0);
00037 
00038   fMinusFocus[0] = new TH1F("fMinusFocus_necc","", 100, 0.0, 20.0);
00039   fMinusFocus[1] = new TH1F("fMinusFocus_nebcc","",100, 0.0, 20.0);
00040   fMinusFocus[2] = new TH1F("fMinusFocus_nmcc","", 100, 0.0, 20.0);
00041   fMinusFocus[3] = new TH1F("fMinusFocus_nmbcc","",100, 0.0, 20.0);
00042   fMinusFocus[4] = new TH1F("fMinusFocus_nnc","",  100, 0.0, 20.0);
00043   fMinusFocus[5] = new TH1F("fMinusFocus_nbnc","", 100, 0.0, 20.0);
00044 }

GenCheck::~GenCheck  ) 
 

Definition at line 52 of file GenCheck.cxx.

References fMinusFocus, and fPlusFocus.

00053 {
00054   for (int i=0; i<6; ++i) {
00055     fPlusFocus[i]->Write();  delete fPlusFocus[i];
00056     fMinusFocus[i]->Write(); delete fMinusFocus[i];
00057   }
00058 }


Member Function Documentation

jobc::Result GenCheck::Ana const edm::EventHandle evt  )  [virtual]
 

Reimplemented from jobc::Module.

Definition at line 62 of file GenCheck.cxx.

References assert_jobc, sim::MCTruth::CCNC(), sim::MCTruth::Enu(), fGenerated, sim::MCTruth::Flux(), fMinusFocus, fPlusFocus, edm::EventHandle::MC(), and sim::MCTruth::NuType().

00063 {
00064   double w;
00065   
00066   // Pull the MC generator information out of the event
00067   std::vector<const sim::MCTruth*> mclist;
00068   evt.MC().Get(".", mclist);
00069   assert_jobc(mclist.size()==1,"Required to have exactly one MCTruth objec");
00070   const sim::MCTruth* mc = mclist[0];
00071 
00072   // Decide which histograms to put the spectrum in
00073   int id = -1;
00074   if (mc->CCNC()==sim::kCC) {
00075     if      (mc->NuType()== 12) id = 0;
00076     else if (mc->NuType()==-12) id = 1;
00077     else if (mc->NuType()== 14) id = 2;
00078     else if (mc->NuType()==-14) id = 3;
00079     else return jobc::kFailed;
00080   }
00081   else {
00082     if (mc->NuType()>0) id = 4;
00083     else                id = 5;
00084   }
00085   if (id==-1) abort();
00086   
00087   // Fill the specta histograms
00088   fGenerated[id]->Fill(mc->Enu());
00089   
00090   w = 
00091     mc->Flux(mc->NuType(),sim::kPlusFocus)/
00092     mc->Flux(mc->NuType(),sim::kGenerator);
00093   fPlusFocus[id]->Fill(mc->Enu(), w);
00094   
00095   w = 
00096     mc->Flux(mc->NuType(),sim::kMinusFocus)/
00097     mc->Flux(mc->NuType(),sim::kGenerator);
00098   fMinusFocus[id]->Fill(mc->Enu(), w);
00099 
00100   return jobc::kPassed;
00101 }

void GenCheck::Update const cfg::Config c  )  [virtual]
 

Implements cfg::Observer.

Definition at line 48 of file GenCheck.cxx.

00048 { }


Member Data Documentation

TH1F* mcchk::GenCheck::fGenerated[6] [private]
 

Spectra as generated.

Definition at line 23 of file GenCheck.h.

Referenced by Ana(), and GenCheck().

TH1F* mcchk::GenCheck::fMinusFocus[6] [private]
 

Spectra for - focus.

Definition at line 25 of file GenCheck.h.

Referenced by Ana(), GenCheck(), and ~GenCheck().

TH1F* mcchk::GenCheck::fPlusFocus[6] [private]
 

Spectra for + focus.

Definition at line 24 of file GenCheck.h.

Referenced by Ana(), GenCheck(), and ~GenCheck().


The documentation for this class was generated from the following files:
Generated on Sat Oct 11 02:35:33 2008 for NOvA Offline by  doxygen 1.3.9.1