CMS 3D CMS Logo

NtupleROOTFile Class Reference

Reads a "h2root" converted cmkin ntpl; Joanna Weng 1/2006. More...

#include <IOMC/NtupleConverter/interface/NtupleROOTFile.h>

List of all members.

Public Member Functions

virtual int getEntries () const
virtual int getId () const
virtual int getIdhep (int j) const
virtual int getIsthep (int j) const
virtual int getJdahep (int j, int idx) const
virtual int getJmohep (int j, int idx) const
virtual int getJsdhep (int j) const
virtual int getJsmhep (int j) const
virtual int getNevhep () const
virtual int getNhep () const
virtual double getPhep (int j, int idx) const
virtual double getVhep (int j, int idx) const
 NtupleROOTFile (std::string filename, int id)
virtual void setEvent (int event) const
virtual ~NtupleROOTFile ()

Protected Attributes

int id_

Private Member Functions

 NtupleROOTFile ()

Private Attributes

TFile * file
Int_t Idhep [4000]
Int_t Isthep [4000]
Int_t Jdahep [4000][2]
Int_t Jmohep [4000][2]
Int_t Jsdhep [4000]
Int_t Jsmhep [4000]
Int_t Nevhep
Int_t Nhep
Float_t Phep [4000][5]
TTree * tree
Float_t Vhep [4000][4]


Detailed Description

Reads a "h2root" converted cmkin ntpl; Joanna Weng 1/2006.

Definition at line 14 of file NtupleROOTFile.h.


Constructor & Destructor Documentation

NtupleROOTFile::NtupleROOTFile ( std::string  filename,
int  id 
)

NtupleROOTFile::~NtupleROOTFile (  )  [virtual]

Definition at line 79 of file NtupleROOTFile.cc.

References file.

00079                                 {
00080         delete tree;
00081         delete file;
00082 }

NtupleROOTFile::NtupleROOTFile (  )  [inline, private]

Definition at line 51 of file NtupleROOTFile.h.

00051 {}


Member Function Documentation

int NtupleROOTFile::getEntries ( void   )  const [virtual]

Definition at line 190 of file NtupleROOTFile.cc.

00190                                     {
00191         return (int)tree->GetEntries();
00192 }

virtual int NtupleROOTFile::getId (  )  const [inline, virtual]

Definition at line 31 of file NtupleROOTFile.h.

References id_.

Referenced by getIsthep(), getJdahep(), getJmohep(), getJsdhep(), and getJsmhep().

00031 {return id_;} 

int NtupleROOTFile::getIdhep ( int  j  )  const [virtual]

Definition at line 104 of file NtupleROOTFile.cc.

References Idhep.

Referenced by Ntuple2HepMCFiller::createParticle().

00104                                        {
00105         return Idhep[j-1];
00106 }

int NtupleROOTFile::getIsthep ( int  j  )  const [virtual]

Definition at line 131 of file NtupleROOTFile.cc.

References getId(), getJsdhep(), getJsmhep(), Isthep, and StDecayID::status.

Referenced by Ntuple2HepMCFiller::createParticle().

00131                                         {
00132         if(getId() != 100){  
00133                 
00134                 int jsm= this->getJsmhep(j);
00135                 int jsd= this->getJsdhep(j);
00136                 // this is the CMS compression for ntuple id 101
00137                 int idj=jsm/16000000;
00138                 int idk=jsd/16000000;
00139                 int status = idk*100+idj;
00140                 return status;
00141         }
00142         return Isthep[j-1];
00143 }

int NtupleROOTFile::getJdahep ( int  j,
int  idx 
) const [virtual]

Definition at line 164 of file NtupleROOTFile.cc.

References getId(), getJsdhep(), and Jdahep.

Referenced by Ntuple2HepMCFiller::number_children().

00164                                                  {
00165         if(getId() != 100){
00166                 int jsd= this->getJsdhep(j);
00167                 // we have to compute it        
00168                 // this is the CMS compression for ntuple id 101
00169                 int da1 = (jsd%16000000)/4000;
00170                 int da2= jsd%4000;
00171                 // 1. daughter
00172                 if (idx==0) return da1;
00173                 // 2. daughter
00174                 if (idx==1) return da2; 
00175         }
00176         return Jdahep[j-1][idx];
00177 }

int NtupleROOTFile::getJmohep ( int  j,
int  idx 
) const [virtual]

Definition at line 147 of file NtupleROOTFile.cc.

References getId(), getJsmhep(), Jmohep, mo1, and mo2.

Referenced by Ntuple2HepMCFiller::buildProductionVertex(), and Ntuple2HepMCFiller::number_parents().

00147                                                  {
00148         if(getId() != 100){
00149                 
00150                 int jsm= this->getJsmhep(j);
00151                 //we have to compute it 
00152                 // this is the CMS compression for ntuple id 101
00153                 int mo1 = (jsm%16000000)/4000;
00154                 int mo2 = jsm%4000;
00155                 // 1. mother
00156                 if (idx==0) return mo1;
00157                 // 2. mother
00158                 if (idx==1) return mo2;         
00159         }
00160         return Jmohep[j-1][idx];
00161 }

int NtupleROOTFile::getJsdhep ( int  j  )  const [virtual]

Definition at line 121 of file NtupleROOTFile.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), getId(), and Jsdhep.

Referenced by getIsthep(), and getJdahep().

00121                                         {
00122         if(getId() != 101){
00123                 cout<<"NtupleROOTFile::getJsdhep: ERROR: "
00124                 <<"only available for ID 101 ntuples"<<endl;
00125                 return 0;
00126         }
00127         return Jsdhep[j-1];
00128 }

int NtupleROOTFile::getJsmhep ( int  j  )  const [virtual]

Definition at line 110 of file NtupleROOTFile.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), getId(), and Jsmhep.

Referenced by getIsthep(), and getJmohep().

00110                                         {
00111         if(getId() != 101){
00112                 cout<<"NtupleROOTFile::getJsmhep: ERROR: "
00113                 <<"only available for ID 101 ntuples"<<endl;
00114                 return 0;
00115         }
00116         return Jsmhep[j-1];
00117 }

int NtupleROOTFile::getNevhep (  )  const [virtual]

Definition at line 94 of file NtupleROOTFile.cc.

Referenced by Ntuple2HepMCFiller::buildProductionVertex(), and Ntuple2HepMCFiller::readCurrentEvent().

00094                                    {
00095   
00096   return  tree->GetEntries();
00097         
00098         // jw 8.3.2006:changed, since there seem to be ntpls 
00099         // where this entry is not correctly filled
00100         //return Nevhep;
00101 }

int NtupleROOTFile::getNhep (  )  const [virtual]

Definition at line 90 of file NtupleROOTFile.cc.

References Nhep.

Referenced by Ntuple2HepMCFiller::number_parents(), and Ntuple2HepMCFiller::toGenEvent().

00090                                 {
00091         return Nhep;
00092 }

double NtupleROOTFile::getPhep ( int  j,
int  idx 
) const [virtual]

Definition at line 180 of file NtupleROOTFile.cc.

References Phep.

Referenced by Ntuple2HepMCFiller::createParticle().

00180                                                   {
00181         return Phep[j-1][idx];
00182 }

double NtupleROOTFile::getVhep ( int  j,
int  idx 
) const [virtual]

Definition at line 185 of file NtupleROOTFile.cc.

References Vhep.

Referenced by Ntuple2HepMCFiller::buildProductionVertex().

00185                                                   {
00186         return Vhep[j-1][idx];
00187 }

void NtupleROOTFile::setEvent ( int  event  )  const [virtual]

Definition at line 85 of file NtupleROOTFile.cc.

Referenced by Ntuple2HepMCFiller::readCurrentEvent().

00085                                              {
00086         tree->GetEntry(event);
00087 }


Member Data Documentation

TFile* NtupleROOTFile::file [private]

Definition at line 36 of file NtupleROOTFile.h.

Referenced by ~NtupleROOTFile().

int NtupleROOTFile::id_ [protected]

Definition at line 34 of file NtupleROOTFile.h.

Referenced by getId().

Int_t NtupleROOTFile::Idhep[4000] [private]

Definition at line 42 of file NtupleROOTFile.h.

Referenced by getIdhep().

Int_t NtupleROOTFile::Isthep[4000] [private]

Definition at line 47 of file NtupleROOTFile.h.

Referenced by getIsthep().

Int_t NtupleROOTFile::Jdahep[4000][2] [private]

Definition at line 49 of file NtupleROOTFile.h.

Referenced by getJdahep().

Int_t NtupleROOTFile::Jmohep[4000][2] [private]

Definition at line 48 of file NtupleROOTFile.h.

Referenced by getJmohep().

Int_t NtupleROOTFile::Jsdhep[4000] [private]

Definition at line 44 of file NtupleROOTFile.h.

Referenced by getJsdhep().

Int_t NtupleROOTFile::Jsmhep[4000] [private]

Definition at line 43 of file NtupleROOTFile.h.

Referenced by getJsmhep().

Int_t NtupleROOTFile::Nevhep [private]

Definition at line 41 of file NtupleROOTFile.h.

Int_t NtupleROOTFile::Nhep [private]

Definition at line 40 of file NtupleROOTFile.h.

Referenced by getNhep().

Float_t NtupleROOTFile::Phep[4000][5] [private]

Definition at line 45 of file NtupleROOTFile.h.

Referenced by getPhep().

TTree* NtupleROOTFile::tree [private]

Definition at line 37 of file NtupleROOTFile.h.

Float_t NtupleROOTFile::Vhep[4000][4] [private]

Definition at line 46 of file NtupleROOTFile.h.

Referenced by getVhep().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:04 2009 for CMSSW by  doxygen 1.5.4