X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=T0%2FAliT0.cxx;h=0b88c23083ff5b21db4b53bdeabbde84b3bb5bbd;hb=b1ab272cd5e5e36627c4036ece3afa6fa9f35422;hp=0fb1afa0100a999ef62bfc3793d0d4929e30d2df;hpb=c41ceaac6d4656983aebd086f4cb7e947eb70d07;p=u%2Fmrichter%2FAliRoot.git diff --git a/T0/AliT0.cxx b/T0/AliT0.cxx index 0fb1afa0100..0b88c23083f 100644 --- a/T0/AliT0.cxx +++ b/T0/AliT0.cxx @@ -37,32 +37,19 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "TClonesArray.h" +#include "AliLoader.h" +#include "AliLog.h" #include "AliLog.h" #include "AliMC.h" -#include "AliLoader.h" #include "AliRun.h" -#include "TClonesArray.h" #include "AliT0.h" -#include "AliT0Loader.h" -#include "AliT0digit.h" -#include "AliT0hit.h" #include "AliT0Digitizer.h" #include "AliT0RawData.h" #include "AliT0RecPoint.h" -#include "AliT0Parameters.h" -#include "AliLog.h" +#include "AliT0digit.h" +#include "AliT0hit.h" ClassImp(AliT0) @@ -104,6 +91,7 @@ AliT0::AliT0(const char *name, const char *title) //_____________________________________________________________________________ AliT0::~AliT0() { + //destructor if (fHits) { fHits->Delete(); delete fHits; @@ -136,7 +124,7 @@ void AliT0::AddHit(Int_t track, Int_t *vol, Float_t *hits) //_____________________________________________________________________________ void AliT0::AddDigit(Int_t besttimeright, Int_t besttimeleft, Int_t meantime, - Int_t timediff, Int_t sumMult, + Int_t timediff, Int_t sumMult, Int_t refpoint, TArrayI *timeCFD, TArrayI *qt0, TArrayI *timeLED, TArrayI *qt1) { @@ -155,46 +143,9 @@ void AliT0::AddDigit(Int_t besttimeright, Int_t besttimeleft, Int_t meantime, fDigits->SetTimeLED(*timeLED); fDigits->SetQT0(*qt0); fDigits->SetQT1(*qt1); + fDigits->SetRefPoint(refpoint); } - -//_____________________________________________________________________________ -void AliT0::BuildGeometry() -{ - // - // Build simple ROOT TNode geometry for event display - // - TNode *node, *top; - const int kColorT0 = 19; - - top=gAlice->GetGeometry()->GetNode("alice"); - - // T0 define the different volumes - new TRotMatrix("rotx999","rot999", 90,0,90,90,180,0); - - new TTUBE("S_0ST1","T0 volume 1","void",5.,10.7,5.3); - top->cd(); - node = new TNode("0ST1","0ST01","S_0ST1",0,0,-69.7,""); - node->SetLineColor(kColorT0); - fNodes->Add(node); - - new TTUBE("S_0ST2","T0 volume 2","void",5.,10.7,5.3); - top->cd(); - node = new TNode("0ST2","0ST2","S_0ST2",0,0,350,"rotx999"); - node->SetLineColor(kColorT0); - fNodes->Add(node); -} - -//_____________________________________________________________________________ -Int_t AliT0::DistanceToPrimitive(Int_t /*px*/, Int_t /*py*/) -{ - // - // Calculate the distance from the mouse to the T0 on the screen - // Dummy routine - // - return 9999; -} - //------------------------------------------------------------------------- void AliT0::Init() { @@ -234,6 +185,7 @@ void AliT0::MakeBranch(Option_t* option) const char *cH = strstr(option,"H"); const char *cD = strstr(option,"D"); const char *cR = strstr(option,"R"); + const char *cS = strstr(option,"S"); if (cH && fLoader->TreeH()) { @@ -247,14 +199,21 @@ void AliT0::MakeBranch(Option_t* option) if (fDigits == 0x0) fDigits = new AliT0digit(); // MakeBranchInTree(fLoader->TreeD(), branchname, // &fDigits, 405, 0); - fLoader->TreeD()->Branch(branchname,"AliT0digit",&fDigits,405,1); + fLoader->TreeD()->Branch(branchname,"AliT0digit",&fDigits); // fLoader->TreeD()->Print(); } if (cR && fLoader->TreeR()) { if (fRecPoints == 0x0) fRecPoints = new AliT0RecPoint(); - MakeBranchInTree(fLoader->TreeR(), branchname, - &fRecPoints, 405, 0); + MakeBranchInTree(fLoader->TreeR(), branchname, &fRecPoints); + } + if (cS && fLoader->TreeS()) + { + if (fDigits == 0x0) fDigits = new AliT0digit(); + // MakeBranchInTree(fLoader->TreeD(), branchname, + // &fDigits, 405, 0); + fLoader->TreeS()->Branch(branchname,"AliT0digit",&fDigits); + // fLoader->TreeD()->Print(); } } @@ -262,6 +221,9 @@ void AliT0::MakeBranch(Option_t* option) //_____________________________________________________________________________ void AliT0::ResetHits() { + // + //reset hits + // AliDetector::ResetHits(); } @@ -278,8 +240,7 @@ void AliT0::ResetDigits() void AliT0::SetTreeAddress() { - TTree *treeH; - treeH = TreeH(); + TTree *treeH = fLoader->TreeH(); if (treeH) { @@ -300,6 +261,13 @@ void AliT0::SetTreeAddress() TBranch* branch = treeR->GetBranch ("T0"); if (branch) branch->SetAddress(&fRecPoints); } + // SDigitizer for Federico + TTree *treeS = fLoader->TreeS(); + if (treeS) { + if (fDigits == 0x0) fDigits = new AliT0digit(); + TBranch* branch = treeS->GetBranch ("T0"); + if (branch) branch->SetAddress(&fDigits); + } } @@ -379,8 +347,8 @@ void AliT0::Raw2Digits(AliRawReader *rawReader,TTree* digitsTree) } - AliT0digit* fDigits = new AliT0digit(); - digitsTree->Branch("T0","AliT0digit",&fDigits,405,1); + fDigits = new AliT0digit(); + digitsTree->Branch("T0","AliT0digit",&fDigits); TArrayI *timeLED = new TArrayI(24);