/*
$Log$
+Revision 1.67 2003/03/03 16:36:16 kowal2
+Added LoadTPCParam method
+
+Revision 1.66 2003/02/11 16:54:07 hristov
+Updated AliTrackReference class (S.Radomski)
+
+Revision 1.65 2002/11/21 22:43:32 alibrary
+Removing AliMC and AliMCProcess
+
+Revision 1.64 2002/10/23 07:17:33 alibrary
+Introducing Riostream.h
+
+Revision 1.63 2002/10/14 14:57:42 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.54.4.3 2002/10/11 08:34:48 hristov
+Updating VirtualMC to v3-09-02
+
+Revision 1.62 2002/09/23 09:22:56 hristov
+The address of the TrackReferences is set (M.Ivanov)
+
+Revision 1.61 2002/09/10 07:06:42 kowal2
+Corrected for the memory leak. Thanks to J. Chudoba and M. Ivanov
+
+Revision 1.60 2002/06/12 14:56:56 kowal2
+Added track length to the reference hits
+
Revision 1.59 2002/06/05 15:37:31 kowal2
Added cross-talk from the wires beyond the first and the last rows
#include <TROOT.h>
#include <TSystem.h>
#include "AliRun.h"
-#include <iostream.h>
+#include <Riostream.h>
#include <stdlib.h>
-#include <fstream.h>
-#include "AliMC.h"
+#include <Riostream.h>
#include "AliMagF.h"
#include "AliTrackReference.h"
class AliTPCFastVector : public TVector {
public :
AliTPCFastVector(Int_t size);
+ virtual ~AliTPCFastVector(){;}
inline Float_t & UncheckedAt(Int_t index) const {return fElements[index];} //fast acces
+
};
AliTPCFastVector::AliTPCFastVector(Int_t size):TVector(size){
if (fHitType>1)
AddHit2(track,vol,hits);
}
-
-void AliTPC::AddTrackReference(Int_t lab, TLorentzVector p, TLorentzVector x, Float_t length){
- //
- // add a trackrefernce to the list
- if (!fTrackReferences) {
- cerr<<"Container trackrefernce not active\n";
- return;
- }
- Int_t nref = fTrackReferences->GetEntriesFast();
- TClonesArray &lref = *fTrackReferences;
- AliTrackReference * ref = new(lref[nref]) AliTrackReference;
- ref->SetMomentum(p[0],p[1],p[2]);
- ref->SetPosition(x[0],x[1],x[2]);
- ref->SetTrack(lab);
- ref->SetLength(length);
-}
//_____________________________________________________________________________
void AliTPC::BuildGeometry()
} // end of the sector digitization
- for(i=0;i<nrows;i++){
+ for(i=0;i<nrows+2;i++){
row[i]->Delete();
delete row[i];
}
branch = treeH->GetBranch(branchname);
if (branch) branch->SetAddress(&fTrackHitsOld);
}
+ //set address to TREETR
+ TTree *treeTR = gAlice->TreeTR();
+ if (treeTR && fTrackReferences) {
+ branch = treeTR->GetBranch(GetName());
+ if (branch) branch->SetAddress(&fTrackReferences);
+ }
+
}
}
+
+////////////////////////////////////////////////////////////////////////
+AliTPCParam* AliTPC::LoadTPCParam(TFile *file) {
+//
+// load TPC paarmeters from a given file or create new if the object
+// is not found there
+//
+ char paramName[50];
+ sprintf(paramName,"75x40_100x60_150x60");
+ AliTPCParam *paramTPC=(AliTPCParam*)file->Get(paramName);
+ if (paramTPC) {
+ cout<<"TPC parameters "<<paramName<<" found."<<endl;
+ } else {
+ cerr<<"TPC parameters not found. Create new (they may be incorrect)."
+ <<endl;
+ paramTPC = new AliTPCParamSR;
+ }
+ return paramTPC;
+
+// the older version of parameters can be accessed with this code.
+// In some cases, we have old parameters saved in the file but
+// digits were created with new parameters, it can be distinguish
+// by the name of TPC TreeD. The code here is just for the case
+// we would need to compare with old data, uncomment it if needed.
+//
+// char paramName[50];
+// sprintf(paramName,"75x40_100x60");
+// AliTPCParam *paramTPC=(AliTPCParam*)in->Get(paramName);
+// if (paramTPC) {
+// cout<<"TPC parameters "<<paramName<<" found."<<endl;
+// } else {
+// sprintf(paramName,"75x40_100x60_150x60");
+// paramTPC=(AliTPCParam*)in->Get(paramName);
+// if (paramTPC) {
+// cout<<"TPC parameters "<<paramName<<" found."<<endl;
+// } else {
+// cerr<<"TPC parameters not found. Create new (they may be incorrect)."
+// <<endl;
+// paramTPC = new AliTPCParamSR;
+// }
+// }
+// return paramTPC;
+
+}
+