CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes

NtupleROOTFile Class Reference

#include <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 mergeVDriftHistosByStation::file, and diffTreeTool::tree.

                                {
        delete tree;
        delete file;
}
NtupleROOTFile::NtupleROOTFile ( ) [inline, private]

Definition at line 51 of file NtupleROOTFile.h.

{}

Member Function Documentation

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

Definition at line 190 of file NtupleROOTFile.cc.

                                    {
        return (int)tree->GetEntries();
}
virtual int NtupleROOTFile::getId ( ) const [inline, virtual]

Definition at line 31 of file NtupleROOTFile.h.

References id_.

{return id_;} 
int NtupleROOTFile::getIdhep ( int  j) const [virtual]

Definition at line 104 of file NtupleROOTFile.cc.

Referenced by Ntuple2HepMCFiller::createParticle().

                                       {
        return Idhep[j-1];
}
int NtupleROOTFile::getIsthep ( int  j) const [virtual]

Definition at line 131 of file NtupleROOTFile.cc.

References getId(), and ntuplemaker::status.

Referenced by Ntuple2HepMCFiller::createParticle().

                                        {
        if(getId() != 100){  
                
                int jsm= this->getJsmhep(j);
                int jsd= this->getJsdhep(j);
                // this is the CMS compression for ntuple id 101
                int idj=jsm/16000000;
                int idk=jsd/16000000;
                int status = idk*100+idj;
                return status;
        }
        return Isthep[j-1];
}
int NtupleROOTFile::getJdahep ( int  j,
int  idx 
) const [virtual]

Definition at line 164 of file NtupleROOTFile.cc.

References getId(), and UserOptions_cff::idx.

Referenced by Ntuple2HepMCFiller::number_children().

                                                 {
        if(getId() != 100){
                int jsd= this->getJsdhep(j);
                // we have to compute it        
                // this is the CMS compression for ntuple id 101
                int da1 = (jsd%16000000)/4000;
                int da2= jsd%4000;
                // 1. daughter
                if (idx==0) return da1;
                // 2. daughter
                if (idx==1) return da2; 
        }
        return Jdahep[j-1][idx];
}
int NtupleROOTFile::getJmohep ( int  j,
int  idx 
) const [virtual]

Definition at line 147 of file NtupleROOTFile.cc.

References getId(), and UserOptions_cff::idx.

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

                                                 {
        if(getId() != 100){
                
                int jsm= this->getJsmhep(j);
                //we have to compute it 
                // this is the CMS compression for ntuple id 101
                int mo1 = (jsm%16000000)/4000;
                int mo2 = jsm%4000;
                // 1. mother
                if (idx==0) return mo1;
                // 2. mother
                if (idx==1) return mo2;         
        }
        return Jmohep[j-1][idx];
}
int NtupleROOTFile::getJsdhep ( int  j) const [virtual]

Definition at line 121 of file NtupleROOTFile.cc.

References gather_cfg::cout, and getId().

                                        {
        if(getId() != 101){
                cout<<"NtupleROOTFile::getJsdhep: ERROR: "
                <<"only available for ID 101 ntuples"<<endl;
                return 0;
        }
        return Jsdhep[j-1];
}
int NtupleROOTFile::getJsmhep ( int  j) const [virtual]

Definition at line 110 of file NtupleROOTFile.cc.

References gather_cfg::cout, and getId().

                                        {
        if(getId() != 101){
                cout<<"NtupleROOTFile::getJsmhep: ERROR: "
                <<"only available for ID 101 ntuples"<<endl;
                return 0;
        }
        return Jsmhep[j-1];
}
int NtupleROOTFile::getNevhep ( ) const [virtual]

Definition at line 94 of file NtupleROOTFile.cc.

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

                                   {
  
  return  tree->GetEntries();
        
        // jw 8.3.2006:changed, since there seem to be ntpls 
        // where this entry is not correctly filled
        //return Nevhep;
}
int NtupleROOTFile::getNhep ( ) const [virtual]

Definition at line 90 of file NtupleROOTFile.cc.

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

                                {
        return Nhep;
}
double NtupleROOTFile::getPhep ( int  j,
int  idx 
) const [virtual]

Definition at line 180 of file NtupleROOTFile.cc.

References UserOptions_cff::idx.

Referenced by Ntuple2HepMCFiller::createParticle().

                                                  {
        return Phep[j-1][idx];
}
double NtupleROOTFile::getVhep ( int  j,
int  idx 
) const [virtual]

Definition at line 185 of file NtupleROOTFile.cc.

References UserOptions_cff::idx.

Referenced by Ntuple2HepMCFiller::buildProductionVertex().

                                                  {
        return Vhep[j-1][idx];
}
void NtupleROOTFile::setEvent ( int  event) const [virtual]

Definition at line 85 of file NtupleROOTFile.cc.

Referenced by Ntuple2HepMCFiller::readCurrentEvent().

                                             {
        tree->GetEntry(event);
}

Member Data Documentation

TFile* NtupleROOTFile::file [private]

Definition at line 36 of file NtupleROOTFile.h.

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.

Int_t NtupleROOTFile::Isthep[4000] [private]

Definition at line 47 of file NtupleROOTFile.h.

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

Definition at line 49 of file NtupleROOTFile.h.

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

Definition at line 48 of file NtupleROOTFile.h.

Int_t NtupleROOTFile::Jsdhep[4000] [private]

Definition at line 44 of file NtupleROOTFile.h.

Int_t NtupleROOTFile::Jsmhep[4000] [private]

Definition at line 43 of file NtupleROOTFile.h.

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.

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

Definition at line 45 of file NtupleROOTFile.h.

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.