CMS 3D CMS Logo

TB06TreeH2 Class Reference

#include <Calibration/EcalTBTools/interface/TB06TreeH2.h>

List of all members.

Public Member Functions

void check ()
void reset (float crystal[11][21])
void store (const int &tableIsMoving, const int &run, const int &event, const int &S6adc, const double &xhodo, const double &yhodo, const double &xslope, const double &yslope, const double &xquality, const double &yquality, const int &icMax, const int &ietaMax, const int &iphiMax, const double &beamEnergy, const double ampl[49], const int &wcAXo, const int &wcAYo, const int &wcBXo, const int &wcBYo, const int &wcCXo, const int &wcCYo, const double &xwA, const double &ywA, const double &xwB, const double &ywB, const double &xwC, const double &ywC, const float &S1adc, const float &S2adc, const float &S3adc, const float &S4adc, const float &VM1, const float &VM2, const float &VM3, const float &VM4, const float &VM5, const float &VM6, const float &VM7, const float &VM8, const float &VMF, const float &VMB, const float &CK1, const float &CK2, const float &CK3, const float &BH1, const float &BH2, const float &BH3, const float &BH4, const float &TOF1S, const float &TOF2S, const float &TOF1J, const float &TOF2J)
 to be called at each loop
 TB06TreeH2 (const std::string &fileName="TB06Tree.root", const std::string &treeName="Analysis")
 ctor
 ~TB06TreeH2 ()
 dtor

Private Attributes

TClonesArray * m_data
int m_dataSize
TFile * m_file
TTree * m_tree


Detailed Description

Definition at line 14 of file TB06TreeH2.h.


Constructor & Destructor Documentation

TB06TreeH2::TB06TreeH2 ( const std::string &  fileName = "TB06Tree.root",
const std::string &  treeName = "Analysis" 
)

ctor

Definition at line 9 of file TB06TreeH2.cc.

References dir, m_data, m_file, and m_tree.

00010                                                :
00011   m_file (0), m_tree (0), m_data (0), m_dataSize (0)  
00012 {
00013   TDirectory *dir = gDirectory ;
00014   m_file = new TFile (fileName.c_str (),"RECREATE") ;
00015   m_file->cd () ;
00016   m_tree = new TTree (treeName.c_str(),"Analysis tree") ;
00017   m_tree->SetAutoSave (10000000) ;
00018   dir->cd () ;
00019 
00020   //  m_tree->cd () ;
00021   m_data = new TClonesArray (TB06RecoH2::Class (), 1) ;
00022   m_data->ExpandCreateFast (1) ;
00023 
00024   //  m_tree->Branch ("EGCO", &m_data, 64000, 2) ;
00025   m_tree->Branch ("TB06O", &m_data, 64000, 2) ;
00026   m_tree->Print () ;
00027  
00028 }

TB06TreeH2::~TB06TreeH2 (  ) 

dtor

Definition at line 33 of file TB06TreeH2.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), m_data, m_file, and m_tree.

00034 {
00035   std::cout << "[TB06TreeH2][dtor] saving TTree " << m_tree->GetName ()
00036             << " with " << m_tree->GetEntries () << " entries"
00037             << " on file: " << m_file->GetName () << std::endl ;
00038 
00039   m_file->Write () ;
00040   delete m_tree ;
00041   m_file->Close () ;
00042   delete m_file ;
00043   delete m_data ;
00044 }


Member Function Documentation

void TB06TreeH2::check (  ) 

Definition at line 216 of file TB06TreeH2.cc.

References TB06RecoH2::convFactor, GenMuonPlsPt100GeV_cfg::cout, eta, TB06RecoH2::event, TB06RecoH2::localMap, m_data, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::run, TB06RecoH2::tableIsMoving, TB06RecoH2::xHodo, TB06RecoH2::xQualityHodo, TB06RecoH2::xSlopeHodo, TB06RecoH2::yHodo, TB06RecoH2::yQualityHodo, and TB06RecoH2::ySlopeHodo.

00217 {
00218   TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;
00219 
00220   std::cout << "[TB06TreeH2][check]reading . . . \n" ;
00221   std::cout << "[TB06TreeH2][check] entry->run: " << entry->run << "\n" ;
00222   std::cout << "[TB06TreeH2][check] entry->event: " << entry->event << "\n" ;
00223   std::cout << "[TB06TreeH2][check] entry->tableIsMoving: " << entry->tableIsMoving << "\n" ;
00224   std::cout << "[TB06TreeH2][check] entry->MEXTLeta: " << entry->MEXTLeta << "\n" ;
00225   std::cout << "[TB06TreeH2][check] entry->MEXTLphi: " << entry->MEXTLphi << "\n" ;
00226   std::cout << "[TB06TreeH2][check] entry->MEXTLenergy: " << entry->MEXTLenergy << "\n" ;
00227 
00228   for (int eta = 0 ; eta<7 ; ++eta)
00229       for (int phi = 0 ; phi<7 ; ++phi)
00230         std::cout << "[TB06TreeH2][check]   entry->localMap[" << eta
00231                   << "][" << phi << "]: "
00232                   << entry->localMap[eta][phi] << "\n" ;
00233 
00234   std::cout << "[TB06TreeH2][check] entry->xHodo: " << entry->xHodo << "\n" ;
00235   std::cout << "[TB06TreeH2][check] entry->yHodo: " << entry->yHodo << "\n" ;
00236   std::cout << "[TB06TreeH2][check] entry->xSlopeHodo: " << entry->xSlopeHodo << "\n" ;
00237   std::cout << "[TB06TreeH2][check] entry->ySlopeHodo: " << entry->ySlopeHodo << "\n" ;
00238   std::cout << "[TB06TreeH2][check] entry->xQualityHodo: " << entry->xQualityHodo << "\n" ;
00239   std::cout << "[TB06TreeH2][check] entry->yQualityHodo: " << entry->yQualityHodo << "\n" ;
00240   std::cout << "[TB06TreeH2][check] entry->convFactor: " << entry->convFactor << "\n" ;
00241 
00242   /* to be implemented with the right variables
00243   std::cout << "[TB06TreeH2][check] ------------------------" << std::endl ;
00244   std::cout << "[TB06TreeH2][check] " << entry->variable_name << std::endl ;
00245   */
00246 }

void TB06TreeH2::reset ( float  crystal[11][21]  ) 

Definition at line 201 of file TB06TreeH2.cc.

References eta, and phi.

00202 {
00203   for (int eta =0 ; eta<11 ; ++eta)    
00204     {
00205       for (int phi =0 ; phi<21 ; ++phi) 
00206         {
00207           crystal[eta][phi] = -999. ;  
00208         }   
00209     }
00210 }

void TB06TreeH2::store ( const int tableIsMoving,
const int run,
const int event,
const int S6adc,
const double &  xhodo,
const double &  yhodo,
const double &  xslope,
const double &  yslope,
const double &  xquality,
const double &  yquality,
const int icMax,
const int ietaMax,
const int iphiMax,
const double &  beamEnergy,
const double  ampl[49],
const int wcAXo,
const int wcAYo,
const int wcBXo,
const int wcBYo,
const int wcCXo,
const int wcCYo,
const double &  xwA,
const double &  ywA,
const double &  xwB,
const double &  ywB,
const double &  xwC,
const double &  ywC,
const float &  S1adc,
const float &  S2adc,
const float &  S3adc,
const float &  S4adc,
const float &  VM1,
const float &  VM2,
const float &  VM3,
const float &  VM4,
const float &  VM5,
const float &  VM6,
const float &  VM7,
const float &  VM8,
const float &  VMF,
const float &  VMB,
const float &  CK1,
const float &  CK2,
const float &  CK3,
const float &  BH1,
const float &  BH2,
const float &  BH3,
const float &  BH4,
const float &  TOF1S,
const float &  TOF2S,
const float &  TOF1J,
const float &  TOF2J 
)

to be called at each loop

Definition at line 50 of file TB06TreeH2.cc.

References TB06RecoH2::beamEnergy, TB06RecoH2::BH1_, TB06RecoH2::BH2_, TB06RecoH2::BH3_, TB06RecoH2::BH4_, TB06RecoH2::CK1_, TB06RecoH2::CK2_, TB06RecoH2::CK3_, TB06RecoH2::convFactor, eta, TB06RecoH2::event, TB06RecoH2::localMap, m_data, m_tree, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLindex, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::reset(), TB06RecoH2::run, TB06RecoH2::S1adc_, TB06RecoH2::S1uncalib_, TB06RecoH2::S25uncalib_, TB06RecoH2::S2adc_, TB06RecoH2::S3adc_, TB06RecoH2::S49uncalib_, TB06RecoH2::S4adc_, TB06RecoH2::S6ADC, TB06RecoH2::S9uncalib_, TB06RecoH2::tableIsMoving, TB06RecoH2::TOF1J_, TB06RecoH2::TOF1S_, TB06RecoH2::TOF2J_, TB06RecoH2::TOF2S_, TB06RecoH2::VM1_, TB06RecoH2::VM2_, TB06RecoH2::VM3_, TB06RecoH2::VM4_, TB06RecoH2::VM5_, TB06RecoH2::VM6_, TB06RecoH2::VM7_, TB06RecoH2::VM8_, TB06RecoH2::VMB_, TB06RecoH2::VMF_, TB06RecoH2::wcAXo_, TB06RecoH2::wcAYo_, TB06RecoH2::wcBXo_, TB06RecoH2::wcBYo_, TB06RecoH2::wcCXo_, TB06RecoH2::wcCYo_, TB06RecoH2::xHodo, TB06RecoH2::xQualityHodo, TB06RecoH2::xSlopeHodo, TB06RecoH2::xwA_, TB06RecoH2::xwB_, TB06RecoH2::xwC_, TB06RecoH2::yHodo, TB06RecoH2::yQualityHodo, TB06RecoH2::ySlopeHodo, TB06RecoH2::ywA_, TB06RecoH2::ywB_, and TB06RecoH2::ywC_.

00078 {
00079 
00080   m_data->Clear () ;
00081   TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;
00082 
00083   entry->reset () ;
00084   //  reset (entry->myCalibrationMap) ;
00085 
00086   entry->tableIsMoving = tableIsMoving ;
00087   entry->run = run ;
00088   entry->event = event ;
00089   entry->S6ADC = S6adc ;
00090 
00091   entry->MEXTLindex = icMax ;
00092   entry->MEXTLeta = ietaMax ;
00093   entry->MEXTLphi = iphiMax ;
00094   entry->MEXTLenergy = ampl[24] ;
00095   entry->beamEnergy = beamEnergy ;
00096 
00097   for (int eta = 0 ; eta<7 ; ++eta)
00098     for (int phi = 0 ; phi<7 ; ++phi)
00099       {
00100         // FIXME capire l'orientamento di phi!
00101         // FIXME capire se eta, phi iniziano da 1 o da 0
00102         entry->localMap[eta][phi] = ampl[eta*7+phi] ;
00103       }
00104 
00105  //[Edgar] S1 uncleaned, uncalibrated energy
00106   entry->S1uncalib_ = ampl[24];
00107   
00108   //[Edgar] S25 uncleaned, uncalibrated energy
00109   for (int eta = 1 ; eta<6 ; ++eta)
00110     for (int phi = 1 ; phi<6 ; ++phi)
00111       {
00112         entry->S25uncalib_ += entry->localMap[eta][phi] ;
00113       }
00114 
00115   //[Edgar] S49 uncleaned, uncalibrated energy
00116   for (int eta = 0 ; eta<7 ; ++eta)
00117     for (int phi = 0 ; phi<7 ; ++phi)
00118       {
00119         entry->S49uncalib_ += entry->localMap[eta][phi] ;
00120       }
00121 
00122   //[Edgar] S9 uncleaned, uncalibrated energy
00123   for (int eta = 2 ; eta<5 ; ++eta)
00124     for (int phi = 2 ; phi<5 ; ++phi)
00125       {
00126         entry->S9uncalib_ += entry->localMap[eta][phi] ;
00127       }
00128 
00129   entry->xHodo = xhodo ;
00130   entry->yHodo = yhodo ;
00131   entry->xSlopeHodo = xslope ;
00132   entry->ySlopeHodo = yslope ;
00133   entry->xQualityHodo = xquality ;
00134   entry->yQualityHodo = yquality ;
00135  entry->wcAXo_ = wcAXo;
00136   entry->wcAYo_ = wcAYo;
00137   entry->wcBXo_ = wcBXo;
00138   entry->wcBYo_ = wcBYo;
00139   entry->wcCXo_ = wcCXo;
00140   entry->wcCYo_ = wcCYo;
00141   entry->xwA_ = xwA;
00142   entry->ywA_ = ywA;
00143   entry->xwB_ = xwB;
00144   entry->ywB_ = ywB;
00145   entry->xwC_ = xwC;
00146   entry->ywC_ = ywC;
00147   entry->S1adc_ = S1adc;
00148   entry->S2adc_ = S2adc;
00149   entry->S3adc_ = S3adc;
00150   entry->S4adc_ = S4adc;
00151   entry->VM1_ = VM1;
00152   entry->VM2_ = VM2;
00153   entry->VM3_ = VM3;
00154   entry->VM4_ = VM4;
00155   entry->VM5_ = VM5;
00156   entry->VM6_ = VM6;
00157   entry->VM7_ = VM7;
00158   entry->VM8_ = VM8;
00159   entry->VMF_ = VMF;
00160   entry->VMB_ = VMB;
00161   entry->CK1_ = CK1;
00162   entry->CK2_ = CK2;
00163   entry->CK3_ = CK3;
00164   entry->BH1_ = BH1;
00165   entry->BH2_ = BH2;
00166   entry->BH3_ = BH3;
00167   entry->BH4_ = BH4;
00168   entry->TOF1S_ = TOF1S;
00169   entry->TOF2S_ = TOF2S;
00170   entry->TOF1J_ = TOF1J;
00171   entry->TOF2J_ = TOF2J;
00172 
00173   entry->convFactor = 0. ;
00174 
00175   /*
00176   // loop over the 5x5 see (1)
00177   for (int xtal=0 ; xtal<25 ; ++xtal) 
00178     {
00179       int ieta = xtal/5 + 3 ;
00180       int iphi = xtal%5 + 8 ;
00181       entry->myCalibrationMap[ieta][iphi] = ampl[xtal] ;
00182     } // loop over the 5x5
00183 
00184   entry->electron_Tr_Pmag_ = beamEnergy ;
00185   
00186         entry->centralCrystalEta_ = ietaMax ;
00187         entry->centralCrystalPhi_ = iphiMax ;
00188         entry->centralCrystalEnergy_ = ampl[12] ; 
00189 
00190   // this is a trick
00191   entry->electron_Tr_Peta_ = xhodo ;
00192   entry->electron_Tr_Pphi_ = yhodo ;
00193   */
00194   m_tree->Fill () ;
00195 }


Member Data Documentation

TClonesArray* TB06TreeH2::m_data [private]

Definition at line 59 of file TB06TreeH2.h.

Referenced by check(), store(), TB06TreeH2(), and ~TB06TreeH2().

int TB06TreeH2::m_dataSize [private]

Definition at line 60 of file TB06TreeH2.h.

TFile* TB06TreeH2::m_file [private]

Definition at line 56 of file TB06TreeH2.h.

Referenced by TB06TreeH2(), and ~TB06TreeH2().

TTree* TB06TreeH2::m_tree [private]

Definition at line 57 of file TB06TreeH2.h.

Referenced by store(), TB06TreeH2(), and ~TB06TreeH2().


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