CMS 3D CMS Logo

Public Member Functions | Private Attributes

TB06TreeH2 Class Reference

#include <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.

                                               :
  m_file (0), m_tree (0), m_data (0), m_dataSize (0)  
{
  TDirectory *dir = gDirectory ;
  m_file = new TFile (fileName.c_str (),"RECREATE") ;
  m_file->cd () ;
  m_tree = new TTree (treeName.c_str(),"Analysis tree") ;
  m_tree->SetAutoSave (10000000) ;
  dir->cd () ;

  //  m_tree->cd () ;
  m_data = new TClonesArray (TB06RecoH2::Class (), 1) ;
  m_data->ExpandCreateFast (1) ;

  //  m_tree->Branch ("EGCO", &m_data, 64000, 2) ;
  m_tree->Branch ("TB06O", &m_data, 64000, 2) ;
  m_tree->Print () ;
 
}
TB06TreeH2::~TB06TreeH2 ( )

dtor

Definition at line 33 of file TB06TreeH2.cc.

References gather_cfg::cout, m_data, m_file, and m_tree.

{
  std::cout << "[TB06TreeH2][dtor] saving TTree " << m_tree->GetName ()
            << " with " << m_tree->GetEntries () << " entries"
            << " on file: " << m_file->GetName () << std::endl ;

  m_file->Write () ;
  delete m_tree ;
  m_file->Close () ;
  delete m_file ;
  delete m_data ;
}

Member Function Documentation

void TB06TreeH2::check ( )

Definition at line 216 of file TB06TreeH2.cc.

References TB06RecoH2::convFactor, gather_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.

{
  TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;

  std::cout << "[TB06TreeH2][check]reading . . . \n" ;
  std::cout << "[TB06TreeH2][check] entry->run: " << entry->run << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->event: " << entry->event << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->tableIsMoving: " << entry->tableIsMoving << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->MEXTLeta: " << entry->MEXTLeta << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->MEXTLphi: " << entry->MEXTLphi << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->MEXTLenergy: " << entry->MEXTLenergy << "\n" ;

  for (int eta = 0 ; eta<7 ; ++eta)
      for (int phi = 0 ; phi<7 ; ++phi)
        std::cout << "[TB06TreeH2][check]   entry->localMap[" << eta
                  << "][" << phi << "]: "
                  << entry->localMap[eta][phi] << "\n" ;

  std::cout << "[TB06TreeH2][check] entry->xHodo: " << entry->xHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->yHodo: " << entry->yHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->xSlopeHodo: " << entry->xSlopeHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->ySlopeHodo: " << entry->ySlopeHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->xQualityHodo: " << entry->xQualityHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->yQualityHodo: " << entry->yQualityHodo << "\n" ;
  std::cout << "[TB06TreeH2][check] entry->convFactor: " << entry->convFactor << "\n" ;

  /* to be implemented with the right variables
  std::cout << "[TB06TreeH2][check] ------------------------" << std::endl ;
  std::cout << "[TB06TreeH2][check] " << entry->variable_name << std::endl ;
  */
}
void TB06TreeH2::reset ( float  crystal[11][21])

Definition at line 201 of file TB06TreeH2.cc.

References eta(), and phi.

{
  for (int eta =0 ; eta<11 ; ++eta)    
    {
      for (int phi =0 ; phi<21 ; ++phi) 
        {
          crystal[eta][phi] = -999. ;  
        }   
    }
}
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, event(), TB06RecoH2::localMap, m_data, m_tree, TB06RecoH2::MEXTLenergy, TB06RecoH2::MEXTLeta, TB06RecoH2::MEXTLindex, TB06RecoH2::MEXTLphi, phi, TB06RecoH2::reset(), TB06RecoH2::run, DTTTrigCorrFirst::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_.

{

  m_data->Clear () ;
  TB06RecoH2 * entry = static_cast<TB06RecoH2*> (m_data->AddrAt (0)) ;

  entry->reset () ;
  //  reset (entry->myCalibrationMap) ;

  entry->tableIsMoving = tableIsMoving ;
  entry->run = run ;
  entry->event = event ;
  entry->S6ADC = S6adc ;

  entry->MEXTLindex = icMax ;
  entry->MEXTLeta = ietaMax ;
  entry->MEXTLphi = iphiMax ;
  entry->MEXTLenergy = ampl[24] ;
  entry->beamEnergy = beamEnergy ;

  for (int eta = 0 ; eta<7 ; ++eta)
    for (int phi = 0 ; phi<7 ; ++phi)
      {
        // FIXME capire l'orientamento di phi!
        // FIXME capire se eta, phi iniziano da 1 o da 0
        entry->localMap[eta][phi] = ampl[eta*7+phi] ;
      }

 //[Edgar] S1 uncleaned, uncalibrated energy
  entry->S1uncalib_ = ampl[24];
  
  //[Edgar] S25 uncleaned, uncalibrated energy
  for (int eta = 1 ; eta<6 ; ++eta)
    for (int phi = 1 ; phi<6 ; ++phi)
      {
        entry->S25uncalib_ += entry->localMap[eta][phi] ;
      }

  //[Edgar] S49 uncleaned, uncalibrated energy
  for (int eta = 0 ; eta<7 ; ++eta)
    for (int phi = 0 ; phi<7 ; ++phi)
      {
        entry->S49uncalib_ += entry->localMap[eta][phi] ;
      }

  //[Edgar] S9 uncleaned, uncalibrated energy
  for (int eta = 2 ; eta<5 ; ++eta)
    for (int phi = 2 ; phi<5 ; ++phi)
      {
        entry->S9uncalib_ += entry->localMap[eta][phi] ;
      }

  entry->xHodo = xhodo ;
  entry->yHodo = yhodo ;
  entry->xSlopeHodo = xslope ;
  entry->ySlopeHodo = yslope ;
  entry->xQualityHodo = xquality ;
  entry->yQualityHodo = yquality ;
 entry->wcAXo_ = wcAXo;
  entry->wcAYo_ = wcAYo;
  entry->wcBXo_ = wcBXo;
  entry->wcBYo_ = wcBYo;
  entry->wcCXo_ = wcCXo;
  entry->wcCYo_ = wcCYo;
  entry->xwA_ = xwA;
  entry->ywA_ = ywA;
  entry->xwB_ = xwB;
  entry->ywB_ = ywB;
  entry->xwC_ = xwC;
  entry->ywC_ = ywC;
  entry->S1adc_ = S1adc;
  entry->S2adc_ = S2adc;
  entry->S3adc_ = S3adc;
  entry->S4adc_ = S4adc;
  entry->VM1_ = VM1;
  entry->VM2_ = VM2;
  entry->VM3_ = VM3;
  entry->VM4_ = VM4;
  entry->VM5_ = VM5;
  entry->VM6_ = VM6;
  entry->VM7_ = VM7;
  entry->VM8_ = VM8;
  entry->VMF_ = VMF;
  entry->VMB_ = VMB;
  entry->CK1_ = CK1;
  entry->CK2_ = CK2;
  entry->CK3_ = CK3;
  entry->BH1_ = BH1;
  entry->BH2_ = BH2;
  entry->BH3_ = BH3;
  entry->BH4_ = BH4;
  entry->TOF1S_ = TOF1S;
  entry->TOF2S_ = TOF2S;
  entry->TOF1J_ = TOF1J;
  entry->TOF2J_ = TOF2J;

  entry->convFactor = 0. ;

  /*
  // loop over the 5x5 see (1)
  for (int xtal=0 ; xtal<25 ; ++xtal) 
    {
      int ieta = xtal/5 + 3 ;
      int iphi = xtal%5 + 8 ;
      entry->myCalibrationMap[ieta][iphi] = ampl[xtal] ;
    } // loop over the 5x5

  entry->electron_Tr_Pmag_ = beamEnergy ;
  
        entry->centralCrystalEta_ = ietaMax ;
        entry->centralCrystalPhi_ = iphiMax ;
        entry->centralCrystalEnergy_ = ampl[12] ; 

  // this is a trick
  entry->electron_Tr_Peta_ = xhodo ;
  entry->electron_Tr_Pphi_ = yhodo ;
  */
  m_tree->Fill () ;
}

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().