/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Member Functions | Protected Attributes | Friends
PerPhyEvent Class Reference

#include <PerPhyEvent.h>

Inheritance diagram for PerPhyEvent:
Inheritance graph
[legend]
Collaboration diagram for PerPhyEvent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PerPhyEvent (const std::vector< std::string > &infiles, const std::string &preferredRecTree, const std::string &preferredEnergy)
virtual ~PerPhyEvent ()
PhyEventmakePhyEvent (Long64_t entry)
PhyEventmakePhyEvent (Int_t fNum, Long64_t entry)

Protected Member Functions

virtual DataSecgetObj (const std::string &path, PhyEvent *pEvt)
Int_t GetEntry (Long64_t entry)
void Init ()
void RegisterObj ()
Bool_t Notify ()
TChain * MakeChain (const char *name)
void link2PhyEvent (IPerEvent *ptr)

Protected Attributes

TTree * fRecReadoutChain
TTree * fCalibStatsChain
TTree * fMuonCombinedChain
Int_t fCurrent
Short_t site
 current Tree number in a TChain
Short_t detector
UInt_t triggerType
Int_t triggerNumber
Int_t triggerTimeSec
Int_t triggerTimeNanoSec
Float_t energy
Float_t rawEvis
Float_t enrec
Float_t eprec
Float_t x
Float_t y
Float_t z
Int_t NPmt
Float_t MaxQ
Float_t Quadrant
Float_t MaxQ_2inchPMT
Int_t Column_2inchPMT
Float_t MiddleTimeRMS
Float_t TRMS
Float_t NPEMax
Float_t NPEMedian
Float_t NPERMS
Float_t NPESum
Float_t Likelihood
Int_t directionStatus
Float_t dx_d
Float_t dy_d
Float_t dz_d
Float_t x_d
Float_t y_d
Float_t z_d
Float_t * _energy
std::map< std::string,
IPerDataSec * > 
m_topo
const std::vector< std::string > & m_files

Friends

friend class PhyEvent

Detailed Description

Definition at line 10 of file PerPhyEvent.h.


Constructor & Destructor Documentation

PerPhyEvent::PerPhyEvent ( const std::vector< std::string > &  infiles,
const std::string &  preferredRecTree,
const std::string &  preferredEnergy 
)

Definition at line 13 of file PerPhyEvent.cc.

    : fCurrent(-1),
      m_files(infiles)
{
    fRecReadoutChain = MakeChain(preferredRecTree.c_str());
    fCalibStatsChain = MakeChain("Event/Data/CalibStats");
    fMuonCombinedChain = MakeChain("Event/Rec/MuonCombined");
    if ( preferredEnergy == "rawEvis" ) {
        _energy = &rawEvis;
    }
    else if ( preferredEnergy == "energy" ) {
        _energy = &energy;
    }
    else if ( preferredEnergy == "enrec" ) {
        _energy = &enrec;
    }
    else if ( preferredEnergy == "eprec" ) {
        _energy = &eprec;
    }
    else {
        std::string msg("ReconInputSvc: unknown preferredEnergy ");
        msg += preferredEnergy;
        throw LafException(msg);
    }

    Init();
    RegisterObj();

    link2PhyEvent(this);
}
PerPhyEvent::~PerPhyEvent ( ) [virtual]

Definition at line 46 of file PerPhyEvent.cc.

{
    std::map<std::string, IPerDataSec*>::iterator it = m_topo.begin();
    while ( it != m_topo.end() ) {
        delete it->second;
        ++it;
    }
    delete fRecReadoutChain->GetCurrentFile();
    link2PhyEvent(0);
}

Member Function Documentation

PhyEvent * PerPhyEvent::makePhyEvent ( Long64_t  entry)

Definition at line 57 of file PerPhyEvent.cc.

{
    PhyEvent* result = 0;
    if ( GetEntry(entry) > 0 ) {
        result = new PhyEvent();
        result->m_entry        = entry;
        result->m_localEntry   = fRecReadoutChain->GetTree()->GetReadEvent();
        result->m_fileNum      = fCurrent;
        //result->m_run          = this->Run;
        //result->m_event        = this->Event;
        result->m_site         = this->site;
        result->m_det          = this->detector;
        result->m_trigType     = this->triggerType;
        result->m_trigNum      = this->triggerNumber;
        result->m_trigTime     = TTimeStamp(this->triggerTimeSec, this->triggerTimeNanoSec);
        result->m_energy       = this->energy;
        result->m_rawEvis      = this->rawEvis;
        result->m_enrec        = this->enrec;
        result->m_eprec        = this->eprec;
        result->m_x            = this->x;
        result->m_y            = this->y;
        result->m_z            = this->z;
        result->m_nPmt         = this->NPmt;
        result->m_maxQ         = this->MaxQ;
        result->m_quadrant     = this->Quadrant;
        result->m_maxQ_2inchPMT = this->MaxQ_2inchPMT;
        result->m_Column_2inchPMT = this->Column_2inchPMT;
        result->m_MiddleTimeRMS = this->MiddleTimeRMS;
        result->m_nPEMax       = this->NPEMax;
        result->m_nPEMedian    = this->NPEMedian;
        result->m_nPERMS       = this->NPERMS;
        result->m_nPESum       = this->NPESum;
        result->m_tRMS         = this->TRMS;
        result->m_Likelihood   = this->Likelihood;
        result->m_DInX          = this->x_d;
        result->m_DInY          = this->y_d;
        result->m_DInZ          = this->z_d;
        result->m_DOutX         = this->dx_d;
        result->m_DOutY         = this->dy_d;
        result->m_DOutZ         = this->dz_d;
        result->m_DStatus      = this->directionStatus;
        result->setEnergy(*(this->_energy));
    }
    return result;
}
PhyEvent * PerPhyEvent::makePhyEvent ( Int_t  fNum,
Long64_t  entry 
)

Definition at line 103 of file PerPhyEvent.cc.

{
    TChain* _chain = (TChain*)fRecReadoutChain;
    Long64_t gEntry = entry + (_chain->GetTreeOffset())[fNum];
    return makePhyEvent(gEntry);
}
DataSec * PerPhyEvent::getObj ( const std::string &  path,
PhyEvent pEvt 
) [protected, virtual]

Implements IPerEvent.

Definition at line 110 of file PerPhyEvent.cc.

{
    DataSec* obj = 0;
    std::map<std::string, IPerDataSec*>::iterator it = m_topo.find(path);
    if ( it != m_topo.end() ) {
        obj = it->second->ToTran(pEvt->m_entry, pEvt->m_fileNum, pEvt->m_localEntry);
    }
    else {
        std::string msg("Unknown Tree name: ");
        msg += path;
        throw LafException(msg);
    }
    return obj;
}
Int_t PerPhyEvent::GetEntry ( Long64_t  entry) [protected]

Definition at line 125 of file PerPhyEvent.cc.

{
    // Read contents of entry.
    TChain* _chain = (TChain*)fRecReadoutChain;
    if ( _chain->LoadTree(entry) >=0 && _chain->GetTreeNumber() != fCurrent ) {
        fCurrent = _chain->GetTreeNumber();
        Notify();
    }
    fRecReadoutChain->GetEntry(entry);
    Int_t stat = fCalibStatsChain->GetEntry(entry);
    fMuonCombinedChain->GetEntry(entry);
    return (fCalibStatsChain->GetTreeNumber() == fCurrent) ? stat : -1;
}
void PerPhyEvent::Init ( ) [protected]

Definition at line 139 of file PerPhyEvent.cc.

{
   // Set branch addresses and branch pointers
   UInt_t nBr = 0;
   fRecReadoutChain->SetMakeClass(1);
   fRecReadoutChain->SetBranchStatus("*", 0, &nBr);
   fRecReadoutChain->SetBranchAddress("site", &site);
   fRecReadoutChain->SetBranchAddress("detector", &detector);
   fRecReadoutChain->SetBranchAddress("triggerType", &triggerType);
   fRecReadoutChain->SetBranchAddress("triggerNumber", &triggerNumber);
   fRecReadoutChain->SetBranchAddress("triggerTimeSec", &triggerTimeSec);
   fRecReadoutChain->SetBranchAddress("triggerTimeNanoSec", &triggerTimeNanoSec);
   fRecReadoutChain->SetBranchAddress("energy", &energy);
   fRecReadoutChain->SetBranchAddress("rawEvis", &rawEvis);
   fRecReadoutChain->SetBranchAddress("enrec", &enrec);
   fRecReadoutChain->SetBranchAddress("eprec", &eprec);
   fRecReadoutChain->SetBranchAddress("x", &x);
   fRecReadoutChain->SetBranchAddress("y", &y);
   fRecReadoutChain->SetBranchAddress("z", &z);

   fCalibStatsChain->SetMakeClass(1);
   fCalibStatsChain->SetBranchStatus("*", 0, &nBr);
   fCalibStatsChain->SetBranchAddress("nHit", &NPmt);
   fCalibStatsChain->SetBranchAddress("MaxQ", &MaxQ);
   fCalibStatsChain->SetBranchAddress("Quadrant", &Quadrant);
   fCalibStatsChain->SetBranchAddress("MaxQ_2inchPMT", &MaxQ_2inchPMT);
   fCalibStatsChain->SetBranchAddress("Column_2inchPMT", &Column_2inchPMT);
   fCalibStatsChain->SetBranchAddress("MiddleTimeRMS", &MiddleTimeRMS);
   fCalibStatsChain->SetBranchAddress("tRMS", &TRMS);
   fCalibStatsChain->SetBranchAddress("nPEMax", &NPEMax);
   fCalibStatsChain->SetBranchAddress("nPEMedian", &NPEMedian);
   fCalibStatsChain->SetBranchAddress("nPERMS", &NPERMS);
   fCalibStatsChain->SetBranchAddress("nPESum", &NPESum);
   fCalibStatsChain->SetBranchAddress("Likelihood", &Likelihood);

   fMuonCombinedChain->SetMakeClass(1);
   fMuonCombinedChain->SetBranchStatus("*", 0, &nBr);
   fMuonCombinedChain->SetBranchAddress("directionStatus",&directionStatus);
   fMuonCombinedChain->SetBranchAddress("x",&x_d);
   fMuonCombinedChain->SetBranchAddress("y",&y_d);
   fMuonCombinedChain->SetBranchAddress("z",&z_d);
   fMuonCombinedChain->SetBranchAddress("dx",&dx_d);
   fMuonCombinedChain->SetBranchAddress("dy",&dy_d);
   fMuonCombinedChain->SetBranchAddress("dz",&dz_d);
}
void PerPhyEvent::RegisterObj ( ) [protected]

Definition at line 185 of file PerPhyEvent.cc.

{
    char* path1 = "Event/Rec/AdSimple";
    IPerDataSec* obj1 = new PerRecReadout( MakeChain(path1) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path1, obj1));

    char* path2 = "Event/Rec/AdScaled";
    IPerDataSec* obj2 = new PerRecReadout( MakeChain(path2) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path2, obj2));

    char* path3 = "Event/Data/CalibStats";
    IPerDataSec* obj3 = new PerCalibStats( MakeChain(path3) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path3, obj3));

    char* path4 = "Event/CalibReadout/CalibReadoutHeader";
    IPerDataSec* obj4 = new PerCalibReadout( MakeChain(path4) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path4, obj4));

    char* path5 = "Event/Rec/RpcSimple";
    IPerDataSec* obj5 = new PerRecRpcReadout( MakeChain(path5) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path5, obj5));

    char* path6 = "Event/Rec/PoolSimple";
    IPerDataSec* obj6 = new PerRecReadout( MakeChain(path6) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path6, obj6));

    char* path7 = "Event/Rec/AdMLRec";
    IPerDataSec* obj7 = new PerRecReadout( MakeChain(path7) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path7, obj7));

    char* path8 = "Event/Data/Physics/MuonRecSimple";
    IPerDataSec* obj8 = new PerMuonRecSimple( MakeChain(path8) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path8, obj8));

    char* path9 = "Event/Rec/MuonCombined";
    IPerDataSec* obj9 = new PerRecReadout( MakeChain(path9) );
    m_topo.insert(std::make_pair<std::string, IPerDataSec*>(path9, obj9));
}
Bool_t PerPhyEvent::Notify ( ) [protected]

Definition at line 224 of file PerPhyEvent.cc.

{
    TChain* _chain = (TChain*)fRecReadoutChain;
    std::cout << "Processing " << _chain->GetFile()->GetName() << std::endl;
    return kTRUE;
}
TChain * PerPhyEvent::MakeChain ( const char *  name) [protected]

Definition at line 231 of file PerPhyEvent.cc.

{
    TChain* chain = new TChain(name, name);
    for ( std::vector<std::string>::const_iterator it = m_files.begin(); it != m_files.end(); ++it) {
        chain->AddFile(it->c_str());
    }
    if ( chain->GetNtrees() != (int)m_files.size() ) {
        delete chain;
        std::string msg("Failed to make TChain: ");
        msg += name;
        throw LafException(msg);
    }
    return chain;
}

Member Data Documentation

TTree* PerPhyEvent::fRecReadoutChain [protected]

Definition at line 32 of file PerPhyEvent.h.

TTree* PerPhyEvent::fCalibStatsChain [protected]

Definition at line 33 of file PerPhyEvent.h.

TTree* PerPhyEvent::fMuonCombinedChain [protected]

Definition at line 34 of file PerPhyEvent.h.

Int_t PerPhyEvent::fCurrent [protected]

Definition at line 36 of file PerPhyEvent.h.

Short_t PerPhyEvent::site [protected]

current Tree number in a TChain

Definition at line 39 of file PerPhyEvent.h.

Short_t PerPhyEvent::detector [protected]

Definition at line 40 of file PerPhyEvent.h.

UInt_t PerPhyEvent::triggerType [protected]

Definition at line 41 of file PerPhyEvent.h.

Int_t PerPhyEvent::triggerNumber [protected]

Definition at line 42 of file PerPhyEvent.h.

Int_t PerPhyEvent::triggerTimeSec [protected]

Definition at line 43 of file PerPhyEvent.h.

Definition at line 44 of file PerPhyEvent.h.

Float_t PerPhyEvent::energy [protected]

Definition at line 45 of file PerPhyEvent.h.

Float_t PerPhyEvent::rawEvis [protected]

Definition at line 46 of file PerPhyEvent.h.

Float_t PerPhyEvent::enrec [protected]

Definition at line 47 of file PerPhyEvent.h.

Float_t PerPhyEvent::eprec [protected]

Definition at line 48 of file PerPhyEvent.h.

Float_t PerPhyEvent::x [protected]

Definition at line 49 of file PerPhyEvent.h.

Float_t PerPhyEvent::y [protected]

Definition at line 50 of file PerPhyEvent.h.

Float_t PerPhyEvent::z [protected]

Definition at line 51 of file PerPhyEvent.h.

Int_t PerPhyEvent::NPmt [protected]

Definition at line 52 of file PerPhyEvent.h.

Float_t PerPhyEvent::MaxQ [protected]

Definition at line 53 of file PerPhyEvent.h.

Float_t PerPhyEvent::Quadrant [protected]

Definition at line 54 of file PerPhyEvent.h.

Float_t PerPhyEvent::MaxQ_2inchPMT [protected]

Definition at line 55 of file PerPhyEvent.h.

Int_t PerPhyEvent::Column_2inchPMT [protected]

Definition at line 56 of file PerPhyEvent.h.

Float_t PerPhyEvent::MiddleTimeRMS [protected]

Definition at line 57 of file PerPhyEvent.h.

Float_t PerPhyEvent::TRMS [protected]

Definition at line 58 of file PerPhyEvent.h.

Float_t PerPhyEvent::NPEMax [protected]

Definition at line 59 of file PerPhyEvent.h.

Float_t PerPhyEvent::NPEMedian [protected]

Definition at line 60 of file PerPhyEvent.h.

Float_t PerPhyEvent::NPERMS [protected]

Definition at line 61 of file PerPhyEvent.h.

Float_t PerPhyEvent::NPESum [protected]

Definition at line 62 of file PerPhyEvent.h.

Float_t PerPhyEvent::Likelihood [protected]

Definition at line 63 of file PerPhyEvent.h.

Int_t PerPhyEvent::directionStatus [protected]

Definition at line 65 of file PerPhyEvent.h.

Float_t PerPhyEvent::dx_d [protected]

Definition at line 66 of file PerPhyEvent.h.

Float_t PerPhyEvent::dy_d [protected]

Definition at line 67 of file PerPhyEvent.h.

Float_t PerPhyEvent::dz_d [protected]

Definition at line 68 of file PerPhyEvent.h.

Float_t PerPhyEvent::x_d [protected]

Definition at line 69 of file PerPhyEvent.h.

Float_t PerPhyEvent::y_d [protected]

Definition at line 70 of file PerPhyEvent.h.

Float_t PerPhyEvent::z_d [protected]

Definition at line 71 of file PerPhyEvent.h.

Float_t* PerPhyEvent::_energy [protected]

Definition at line 73 of file PerPhyEvent.h.

std::map<std::string, IPerDataSec*> PerPhyEvent::m_topo [protected]

Definition at line 75 of file PerPhyEvent.h.

const std::vector<std::string>& PerPhyEvent::m_files [protected]

Definition at line 76 of file PerPhyEvent.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:51:07 for ReconInputSvc by doxygen 1.7.4