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

testStdNtup.cc File Reference

#include <iostream>
#include "StdNtup/StdNtup.h"
#include "TRandom.h"
#include "TH1F.h"

Go to the source code of this file.

Functions

void printusage ()
int main (int argc, char **argv)

Variables

StdNtupgMyNt = new StdNtup
StdNtupgMyNt2 = new StdNtup


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 18 of file testStdNtup.cc.

References stdnt::SAnaNtup::Add(), stdnt::StdNtup::AddLepKin(), stdnt::StdNtup::AddNeuKin(), stdnt::StdNtup::Clear(), stdnt::SAnaNtup::Fill(), gMyNt, gMyNt2, and stdnt::SAnaNtup::Save().

00019 {
00020 
00021   SAnaNtup& sn = SAnaNtup::Instance();
00022 
00023   string myTreeName = "MDMReco";
00024   string myTreeName2 = "JMPReco";
00025   sn.Add(&gMyNt,string("StdNtup"),myTreeName);
00026   sn.Add(&gMyNt2,string("StdNtup"),myTreeName2);
00027 
00028   float Kin[4];
00029   TRandom* myRand = new TRandom(257631);
00030 
00031   for (int i=0; i<100000; ++i) {
00032     gMyNt->Clear();
00033     gMyNt2->Clear();
00034 
00035     Kin[0] = myRand->Landau(2.8,0.2);
00036     gMyNt->AddNeuKin(Kin);
00037     gMyNt2->AddNeuKin(Kin);
00038 
00039     Kin[0] = myRand->Gaus(1.,0.2);
00040     gMyNt->AddLepKin(Kin);
00041     gMyNt2->AddLepKin(Kin);
00042 
00043     sn.Fill(myTreeName);
00044     sn.Fill(myTreeName2);
00045   }
00046 
00047   //  sn.Print(myTreeName);
00048   
00049   sn.Save(myTreeName);
00050   sn.Save(myTreeName2);
00051 
00052   return 1;
00053 
00054 }

void printusage  ) 
 

Definition at line 12 of file testStdNtup.cc.

00013 {
00014   cerr << " usage: StdNtupTest " << endl;
00015   cerr << " NB: no command line args checking !" << endl;
00016 }


Variable Documentation

StdNtup* gMyNt = new StdNtup [static]
 

Definition at line 9 of file testStdNtup.cc.

Referenced by main().

StdNtup* gMyNt2 = new StdNtup [static]
 

Definition at line 10 of file testStdNtup.cc.

Referenced by main().


Generated on Thu Sep 4 02:05:31 2008 for NOvA Offline by doxygen 1.3.5