Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 15 of file testStdNtup.cc.

References SAnaNtup::Add(), StdNtup::Clear(), SAnaNtup::Fill(), gMyNt, gMyNt2, SAnaNtup::Instance(), SAnaNtup::Save(), StdNtup::SetMCElep(), and StdNtup::SetMCEnu().

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

void printusage  ) 
 

Definition at line 9 of file testStdNtup.cc.

00010 {
00011   cerr << " usage: StdNtupTest " << endl;
00012   cerr << " NB: no command line args checking !" << endl;
00013 }


Variable Documentation

StdNtup* gMyNt = new StdNtup [static]
 

Definition at line 6 of file testStdNtup.cc.

Referenced by main().

StdNtup* gMyNt2 = new StdNtup [static]
 

Definition at line 7 of file testStdNtup.cc.

Referenced by main().


Generated on Mon Nov 23 04:45:29 2009 for NOvA Offline by  doxygen 1.3.9.1