#include <math.h>
#include <TTree.h>
#include "THiRASiDet.h"
ClassImp(THiRASiDet);
THiRASiDet::THiRASiDet(const THiRASiDet &det) : TObject(det)
{
((THiRASiDet&)det).Copy(*this);
}
void THiRASiDet::Copy(TObject &det) const
{
TObject::Copy((TObject&)det);
((THiRASiDet&)det).fName = fName;
((THiRASiDet&)det).fTitle = fTitle ;
((THiRASiDet&)det).fAddRndm = fAddRndm;
((THiRASiDet&)det).fMb = fMb;
((THiRASiDet&)det).fSlot = fSlot;
((THiRASiDet&)det).Clear();
}
void THiRASiDet::Calculate()
{
}
void THiRASiDet::Calibrate()
{
}
void THiRASiDet::Clear(Option_t *)
{
fCbSequence = 0;
fChSequence = 0;
fHitSequence = 0;
memset(ERaw,'\0',sizeof(ERaw));
memset(TRaw,'\0',sizeof(TRaw));
memset(E,'\0',sizeof(E));
memset(T,'\0',sizeof(T));
Emax = 0;
Emaxch = 99;
rawMult = 0;
}
Int_t THiRASiDet::GetEntry(Long64_t entry,Int_t getall)
{
Int_t getBytes=0;
getBytes += b_ERaw->GetEntry(entry,getall);
getBytes += b_TRaw->GetEntry(entry,getall);
getBytes += b_E->GetEntry(entry,getall);
getBytes += b_T->GetEntry(entry,getall);
getBytes += b_Emax->GetEntry(entry,getall);
getBytes += b_Emaxch->GetEntry(entry,getall);
getBytes += b_rawMult->GetEntry(entry,getall);
return getBytes;
}
Short_t THiRASiDet::GetChReadOrder(Int_t strip)
{
Short_t value = GetHitReadOrder(strip);
if(strip<0 || strip>31){
return -1;
}else if(value!=0) {
value += fChSequence;
return value;
}else{
return 0;
}
}
Short_t THiRASiDet::GetHitReadOrder(Int_t strip)
{
printf("FIX ME!!! \n");
return -1;
Short_t counter = 1;
if(strip<0 || strip>31) return -1;
if(((fHitSequence>>(strip))&0x00000001)!=0x00000001) return 0;
for(Int_t i=0; i<strip; i=i+2) if(((fHitSequence>>(i))&0x00000001)==0x00000001) counter++;
if((strip%2)==1){
for(Int_t j=1; j<strip; j=j+2) if(((fHitSequence>>(j))&0x00000001)==0x00000001) counter++;
}
return counter;
}
void THiRASiDet::InitClass(TString name)
{
SetName(name);
fAddRndm = kFALSE;
Clear();
}
void THiRASiDet::InitTree(TTree *tree)
{
fChain = tree;
fCurrent = -1;
#ifdef TESTING
fChain->SetMakeClass(1);
#endif
b_fCbSequence = fChain->GetBranch(fName + ".fCbSequence");
b_fChSequence = fChain->GetBranch(fName + ".fChSequence");
b_fHitSequence = fChain->GetBranch(fName + ".fHitSequence");
b_ERaw = fChain->GetBranch(fName + ".ERaw[32]");
b_TRaw = fChain->GetBranch(fName + ".TRaw[32]");
b_E = fChain->GetBranch(fName + ".E[32]");
b_T = fChain->GetBranch(fName + ".T[32]");
b_Emax = fChain->GetBranch(fName + ".Emax");
b_Emaxch = fChain->GetBranch(fName + ".Emaxch");
b_rawMult = fChain->GetBranch(fName + ".rawMult");
}
Bool_t THiRASiDet::IsBad(Int_t strip)
{
if(fBadStrips[strip]==1) return kTRUE;
return kFALSE;
}
void THiRASiDet::SetBad(Int_t strip, Int_t bitValue)
{
if((bitValue==0 || bitValue==1) && (strip>=0 && strip<THIRA_SI_CHANNELS)) fBadStrips.set(strip,bitValue);
else if(strip==99) ;
else if(strip<0 || strip>=THIRA_SI_CHANNELS) printf("* ERROR: Invalid strip!!!\n");
else printf("* ERROR: Invalid bitValue!!!\n");
}
void THiRASiDet::SetName(const Char_t *name)
{
fName = name;
}
void THiRASiDet::SetNameTitle(const Char_t *name, const Char_t *title)
{
fName = name;
fTitle = title;
}
void THiRASiDet::SetTitle(const Char_t *title)
{
fTitle = title;
}
Last change: Sun Dec 21 12:38:49 2008
Last generated: 2008-12-21 12:38
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.