X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliDetector.cxx;h=9fd0964e5c37ef1bd95e59f9ec50c1ec2174eef2;hb=a70a8477d26b25b876ca27a871abe682a89ce2d1;hp=58f2fd4f63332cad5da3eace6400c9da86bb9b7f;hpb=90e48c0cb3b95b780dbb81c14bab093854603c11;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliDetector.cxx b/STEER/AliDetector.cxx index 58f2fd4f633..9fd0964e5c3 100644 --- a/STEER/AliDetector.cxx +++ b/STEER/AliDetector.cxx @@ -34,13 +34,13 @@ /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include "AliLog.h" #include "AliConfig.h" #include "AliDetector.h" #include "AliHit.h" -#include "AliPoints.h" #include "AliLoader.h" #include "AliRun.h" #include "AliMC.h" @@ -60,7 +60,6 @@ AliDetector::AliDetector(): fCurIterHit(0), fHits(0), fDigits(0), - fPoints(0), fLoader(0x0) { // @@ -68,24 +67,6 @@ AliDetector::AliDetector(): // } -//_______________________________________________________________________ -AliDetector::AliDetector(const AliDetector &det): - AliModule(det), - fTimeGate(200.e-9), - fIshunt(0), - fNhits(0), - fNdigits(0), - fBufferSize(1600), - fMaxIterHit(0), - fCurIterHit(0), - fHits(0), - fDigits(0), - fPoints(0), - fLoader(0x0) -{ - det.Copy(*this); -} - //_____________________________________________________________________________ AliDetector::AliDetector(const char* name,const char *title): AliModule(name,title), @@ -98,7 +79,6 @@ AliDetector::AliDetector(const char* name,const char *title): fCurIterHit(0), fHits(0), fDigits(0), - fPoints(0), fLoader(0x0) { // @@ -119,12 +99,6 @@ AliDetector::~AliDetector() // Destructor // - // Delete space point structure - if (fPoints) { - fPoints->Delete(); - delete fPoints; - fPoints = 0; - } // Delete digits structure if (fDigits) { fDigits->Delete(); @@ -148,6 +122,13 @@ void AliDetector::Publish(const char */*dir*/, void */*address*/, const char */* MayNotUse("Publish"); } +//_______________________________________________________________________ +void AliDetector::AddAlignableVolumes() const +{ + // + AliWarning(Form("%s still has to implement the AddAlignableVolumes method!",GetName())); +} + //_______________________________________________________________________ TBranch* AliDetector::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size, @@ -167,7 +148,6 @@ TBranch* AliDetector::MakeBranchInTree(TTree *tree, const char* name, // // // -// if (GetDebug()>1) AliDebug(2,Form("Making Branch %s",name)); if (tree == 0x0) @@ -213,15 +193,6 @@ void AliDetector::Browse(TBrowser *b) } } -//_______________________________________________________________________ -void AliDetector::Copy(TObject &) const -{ - // - // Copy *this onto det -- not implemented - // - AliFatal("Not implemented"); -} - //_______________________________________________________________________ void AliDetector::FinishRun() { @@ -241,8 +212,8 @@ AliHit* AliDetector::FirstHit(Int_t track) // track is returned // if(track>=0) { - gAlice->ResetHits(); //stupid = if N detector this method is called N times - TreeH()->GetEvent(track); //skowron + gAlice->GetMCApp()->ResetHits(); //stupid = if N detector this method is called N times + fLoader->TreeH()->GetEvent(track); //skowron } // fMaxIterHit=fHits->GetEntriesFast(); @@ -268,88 +239,6 @@ AliHit* AliDetector::NextHit() } } -//_______________________________________________________________________ -void AliDetector::LoadPoints(Int_t) -{ - // - // Store x, y, z of all hits in memory - // - if (fHits == 0) - { - AliError(Form("fHits == 0. Name is %s",GetName())); - return; - } - // - Int_t nhits = fHits->GetEntriesFast(); - if (nhits == 0) - { -// Error("LoadPoints","nhits == 0. Name is %s",GetName()); - return; - } - Int_t tracks = gAlice->GetMCApp()->GetNtrack(); - if (fPoints == 0) fPoints = new TObjArray(tracks); - AliHit *ahit; - // - Int_t *ntrk=new Int_t[tracks]; - Int_t *limi=new Int_t[tracks]; - Float_t **coor=new Float_t*[tracks]; - for(Int_t i=0;i(fHits->UncheckedAt(hit)); - trk=ahit->GetTrack(); - if(trk>tracks) AliFatal(Form("Found track number %d, max track %d",trk, tracks)); - if(ntrk[trk]==limi[trk]) - { - // - // Initialise a new track - fp=new Float_t[3*(limi[trk]+chunk)]; - if(coor[trk]) - { - memcpy(fp,coor[trk],sizeof(Float_t)*3*limi[trk]); - delete [] coor[trk]; - } - limi[trk]+=chunk; - coor[trk] = fp; - } - else - { - fp = coor[trk]; - } - fp[3*ntrk[trk] ] = ahit->X(); - fp[3*ntrk[trk]+1] = ahit->Y(); - fp[3*ntrk[trk]+2] = ahit->Z(); - ntrk[trk]++; - } - // - for(trk=0; trkSetMarkerColor(GetMarkerColor()); - points->SetMarkerSize(GetMarkerSize()); - points->SetDetector(this); - points->SetParticle(trk); - points->SetPolyMarker(ntrk[trk],coor[trk],GetMarkerStyle()); - fPoints->AddAt(points,trk); - delete [] coor[trk]; - coor[trk]=0; - } - } - delete [] coor; - delete [] ntrk; - delete [] limi; -} - //_______________________________________________________________________ void AliDetector::MakeBranch(Option_t *option) { @@ -360,9 +249,9 @@ void AliDetector::MakeBranch(Option_t *option) AliDebug(2,Form(" for %s",GetName())); const char *cH = strstr(option,"H"); - if (fHits && TreeH() && cH) + if (fHits && fLoader->TreeH() && cH) { - MakeBranchInTree(TreeH(), GetName(), &fHits, fBufferSize, 0); + MakeBranchInTree(fLoader->TreeH(), GetName(), &fHits, fBufferSize, 0); } } @@ -386,19 +275,6 @@ void AliDetector::ResetHits() if (fHits) fHits->Clear(); } -//_______________________________________________________________________ -void AliDetector::ResetPoints() -{ - // - // Reset array of points - // - if (fPoints) { - fPoints->Delete(); - delete fPoints; - fPoints = 0; - } -} - //_______________________________________________________________________ void AliDetector::SetTreeAddress() { @@ -409,7 +285,7 @@ void AliDetector::SetTreeAddress() // // Branch address for hit tree - TTree *tree = TreeH(); + TTree* tree = fLoader->TreeH(); if (tree && fHits) { branch = tree->GetBranch(GetName()); if (branch) @@ -430,8 +306,6 @@ void AliDetector::SetTreeAddress() branch = treeD->GetBranch(GetName()); if (branch) branch->SetAddress(&fDigits); } - - AliModule::SetTreeAddress(); } //_______________________________________________________________________ @@ -465,18 +339,4 @@ AliLoader* AliDetector::MakeLoader(const char* topfoldername) return fLoader; } -//_______________________________________________________________________ -TTree* AliDetector::TreeH() const -{ -//Get the hits container from the folder - if (GetLoader() == 0x0) - { - //sunstitude this with make getter when we can obtain the event folder name - AliError("Can not get the getter"); - return 0x0; - } - - TTree* tree = (TTree*)GetLoader()->TreeH(); - return tree; -}