/*
$Log$
+Revision 1.11 2001/01/26 19:58:46 hristov
+Major upgrade of AliRoot code
+
+Revision 1.10 2001/01/17 10:50:50 hristov
+Corrections to destructors
+
+Revision 1.9 2000/12/12 18:19:06 alibrary
+Introduce consistency check when loading points
+
+Revision 1.8 2000/11/30 07:12:48 alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.7 2000/10/02 21:28:14 fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.6 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
+Revision 1.5 1999/09/29 09:24:29 fca
+Introduction of the Copyright and cvs Log
+
*/
///////////////////////////////////////////////////////////////////////////////
//End_Html
// //
///////////////////////////////////////////////////////////////////////////////
+
+#include <assert.h>
+
+#include <TTree.h>
+#include <TBrowser.h>
+#include <TFile.h>
+
#include "AliDetector.h"
#include "AliRun.h"
#include "AliHit.h"
#include "AliPoints.h"
-#include <TClass.h>
-#include <TNode.h>
-#include <TRandom.h>
-
// Static variables for the hit iterator routines
static Int_t sMaxIterHit=0;
static Int_t sCurIterHit=0;
fDigits = 0;
fTimeGate = 200.e-9;
fBufferSize = 16000;
+ fDigitsFile = 0;
}
//_____________________________________________________________________________
fNdigits = 0;
fPoints = 0;
fBufferSize = 16000;
+ fDigitsFile = 0;
}
//_____________________________________________________________________________
fNdigits = 0;
//
// Delete space point structure
- if (fPoints) fPoints->Delete();
- delete fPoints;
- fPoints = 0;
+ if (fPoints) {
+ fPoints->Delete();
+ delete fPoints;
+ fPoints = 0;
+ }
+ // Delete digits structure
+ if (fDigits) {
+ fDigits->Delete();
+ delete fDigits;
+ fDigits = 0;
+ }
+ if (fDigitsFile) delete [] fDigitsFile;
}
//_____________________________________________________________________________
}
}
+//_____________________________________________________________________________
+void AliDetector::Copy(AliDetector &det) const
+{
+ //
+ // Copy *this onto det -- not implemented
+ //
+ Fatal("Copy","Not implemented~\n");
+}
+
//_____________________________________________________________________________
void AliDetector::FinishRun()
{
for (Int_t hit=0;hit<nhits;hit++) {
ahit = (AliHit*)fHits->UncheckedAt(hit);
trk=ahit->GetTrack();
+ assert(trk<=tracks);
if(ntrk[trk]==limi[trk]) {
//
// Initialise a new track
} else {
fp = coor[trk];
}
- fp[3*ntrk[trk] ] = ahit->fX;
- fp[3*ntrk[trk]+1] = ahit->fY;
- fp[3*ntrk[trk]+2] = ahit->fZ;
+ fp[3*ntrk[trk] ] = ahit->X();
+ fp[3*ntrk[trk]+1] = ahit->Y();
+ fp[3*ntrk[trk]+2] = ahit->Z();
ntrk[trk]++;
}
//
}
//_____________________________________________________________________________
-void AliDetector::MakeBranch(Option_t *option)
+void AliDetector::MakeBranch(Option_t *option, char *file)
{
//
// Create a new branch in the current Root Tree
// The branch of fHits is automatically split
//
+
char branchname[10];
sprintf(branchname,"%s",GetName());
//
// Get the pointer to the header
- char *H = strstr(option,"H");
+ const char *cH = strstr(option,"H");
//
- if (fHits && gAlice->TreeH() && H) {
- gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize);
- printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
+ if (fHits && gAlice->TreeH() && cH) {
+ gAlice->MakeBranchInTree(gAlice->TreeH(),
+ branchname, &fHits, fBufferSize, file) ;
}
+
+ const char *cD = strstr(option,"D");
+
+ if (cD) {
+ if (file) {
+ fDigitsFile = new char[strlen (file)];
+ strcpy(fDigitsFile,file);
+ }
+ }
}
//_____________________________________________________________________________
}
}
-//_____________________________________________________________________________
-void AliDetector::Streamer(TBuffer &R__b)
-{
- //
- // Stream an object of class Detector.
- //
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- AliModule::Streamer(R__b);
- R__b >> fTimeGate;
- R__b >> fIshunt;
- //R__b >> fNhits;
- //
- // Stream the pointers but not the TClonesArrays
- R__b >> fHits; // diff
- R__b >> fDigits; // diff
-
- } else {
- R__b.WriteVersion(AliDetector::IsA());
- TNamed::Streamer(R__b);
- TAttLine::Streamer(R__b);
- TAttMarker::Streamer(R__b);
- AliModule::Streamer(R__b);
- R__b << fTimeGate;
- R__b << fIshunt;
- //R__b << fNhits;
- //
- // Stream the pointers but not the TClonesArrays
- R__b << fHits; // diff
- R__b << fDigits; // diff
- }
-}