ClassImp(AliReconstruction)
//_____________________________________________________________________________
-const char* AliReconstruction::fgkDetectorName[AliReconstruction::fgkNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"};
+const char* AliReconstruction::fgkDetectorName[AliReconstruction::kNDetectors] = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"};
//_____________________________________________________________________________
AliReconstruction::AliReconstruction(const char* gAliceFilename) :
fOptions(),
fLoadAlignFromCDB(kTRUE),
fLoadAlignData("ALL"),
- fESDPar(""),
fUseHLTData(),
fRunInfo(NULL),
fEventInfo(),
// create reconstruction object with default parameters
gGeoManager = NULL;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
fReconstructor[iDet] = NULL;
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
fOptions(),
fLoadAlignFromCDB(rec.fLoadAlignFromCDB),
fLoadAlignData(rec.fLoadAlignData),
- fESDPar(rec.fESDPar),
fUseHLTData(rec.fUseHLTData),
fRunInfo(NULL),
fEventInfo(),
for (Int_t i = 0; i < rec.fOptions.GetEntriesFast(); i++) {
if (rec.fOptions[i]) fOptions.Add(rec.fOptions[i]->Clone());
}
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
fReconstructor[iDet] = NULL;
fLoader[iDet] = NULL;
fTracker[iDet] = NULL;
fLoadAlignFromCDB = rec.fLoadAlignFromCDB;
fLoadAlignData = rec.fLoadAlignData;
- fESDPar = rec.fESDPar;
fUseHLTData = rec.fUseHLTData;
delete fRunInfo; fRunInfo = NULL;
fRecoParam = rec.fRecoParam;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
delete fReconstructor[iDet]; fReconstructor[iDet] = NULL;
delete fLoader[iDet]; fLoader[iDet] = NULL;
delete fTracker[iDet]; fTracker[iDet] = NULL;
AliCDBPath aPath(calibType);
if(!aPath.IsValid()){
// if calibType is not wildcard but it is a valid detector, add "/*" to make it a valid path
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if(!strcmp(calibType, fgkDetectorName[iDet])) {
aPath.SetPath(Form("%s/*", calibType));
AliInfo(Form("Path for specific storage set to %s", aPath.GetPath().Data()));
// // check that calibType refers to a "valid" detector name
// Bool_t isDetector = kFALSE;
-// for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+// for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
// TString detName = fgkDetectorName[iDet];
// if(aPath.GetLevel0() == detName) {
// isDetector = kTRUE;
TString detStr = detectors;
TString loadAlObjsListOfDets = "";
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if(!IsSelected(fgkDetectorName[iDet], detStr)) continue;
if(!strcmp(fgkDetectorName[iDet],"HLT")) continue;
// First check if the reco-params are global
if(!strcmp(detector, "GRP")) {
par->SetAsDefault();
- fRecoParam.AddDetRecoParam(fgkNDetectors,par);
+ fRecoParam.AddDetRecoParam(kNDetectors,par);
return;
}
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if(!strcmp(detector, fgkDetectorName[iDet])) {
par->SetAsDefault();
fRecoParam.AddDetRecoParam(iDet,par);
AliCDBManager::Instance()->Get("GRP/CTP/Config");
TString detStr = fLoadCDB;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",fgkDetectorName[iDet]));
}
fhltesd->WriteToTree(fhlttree);
fhlttree->GetUserInfo()->Add(fhltesd);
- ProcInfo_t ProcInfo;
- gSystem->GetProcInfo(&ProcInfo);
- AliInfo(Form("Current memory usage %d %d", ProcInfo.fMemResident, ProcInfo.fMemVirtual));
+ ProcInfo_t procInfo;
+ gSystem->GetProcInfo(&procInfo);
+ AliInfo(Form("Current memory usage %d %d", procInfo.fMemResident, procInfo.fMemVirtual));
//QA
//Initialize the QA and start of cycle
// Set the reco-params
{
TString detStr = fLoadCDB;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor *reconstructor = GetReconstructor(iDet);
if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) {
// Set most probable pt, for B=0 tracking
// Get the global reco-params. They are atposition 16 inside the array of detectors in fRecoParam
- const AliGRPRecoParam *grpRecoParam = dynamic_cast<const AliGRPRecoParam*>(fRecoParam.GetDetRecoParam(fgkNDetectors));
+ const AliGRPRecoParam *grpRecoParam = dynamic_cast<const AliGRPRecoParam*>(fRecoParam.GetDetRecoParam(kNDetectors));
if (grpRecoParam) AliExternalTrackParam::SetMostProbablePt(grpRecoParam->GetMostProbablePt());
// Fill raw-data error log into the ESD
// Temporary fix to avoid problems with HLT that overwrites the offline ESDs
if (detectors.Contains("ALL")) {
detectors="";
- for (Int_t idet=0; idet<fgkNDetectors; ++idet){
+ for (Int_t idet=0; idet<kNDetectors; ++idet){
detectors += fgkDetectorName[idet];
detectors += " ";
}
new (fesdf) AliESDfriend(); // Reset...
}
- ProcInfo_t ProcInfo;
- gSystem->GetProcInfo(&ProcInfo);
- AliInfo(Form("Event %d -> Current memory usage %d %d",iEvent, ProcInfo.fMemResident, ProcInfo.fMemVirtual));
+ ProcInfo_t procInfo;
+ gSystem->GetProcInfo(&procInfo);
+ AliInfo(Form("Event %d -> Current memory usage %d %d",iEvent, procInfo.fMemResident, procInfo.fMemVirtual));
fEventInfo.Reset();
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (fReconstructor[iDet])
fReconstructor[iDet]->SetRecoParam(NULL);
}
ftree->GetUserInfo()->Add(cdbListCopy);
- if(fESDPar.Contains("ESD.par")){
- AliInfo("Attaching ESD.par to Tree");
- TNamed *fn = CopyFileToTNamed(fESDPar.Data(),"ESD.par");
- ftree->GetUserInfo()->Add(fn);
- }
-
-
ffile->cd();
if (fWriteESDfriend)
AliCodeTimerAuto("")
TString detStr = detectors;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor* reconstructor = GetReconstructor(iDet);
if (!reconstructor) continue;
AliMultiplicity *mult = fVertexer->GetMultiplicity();
if(mult)esd->SetMultiplicity(mult);
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (fTracker[iDet]) fTracker[iDet]->SetVertex(vtxPos, vtxErr);
}
delete vertex;
AliInfo("running HLT tracking");
// Get a pointer to the HLT reconstructor
- AliReconstructor *reconstructor = GetReconstructor(fgkNDetectors-1);
+ AliReconstructor *reconstructor = GetReconstructor(kNDetectors-1);
if (!reconstructor) return kFALSE;
// TPC + ITS
// pass 2: ALL backwards
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!fTracker[iDet]) continue;
AliDebug(1, Form("%s back propagation", fgkDetectorName[iDet]));
static Int_t eventNr=0;
TString detStr = detectors;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor* reconstructor = GetReconstructor(iDet);
if (!reconstructor) continue;
if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
// load all base libraries to get the loader classes
TString libs = gSystem->GetLibraries();
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
TString detName = fgkDetectorName[iDet];
if (detName == "HLT") continue;
if (libs.Contains("lib" + detName + "base.so")) continue;
AliInfo("Creating trackers");
TString detStr = detectors;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
AliReconstructor* reconstructor = GetReconstructor(iDet);
if (!reconstructor) continue;
{
// delete trackers and the run loader and close and delete the file
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
delete fReconstructor[iDet];
fReconstructor[iDet] = NULL;
fLoader[iDet] = NULL;
}
-TNamed* AliReconstruction::CopyFileToTNamed(TString fPath,TString pName){
- // Dump a file content into a char in TNamed
- ifstream in;
- in.open(fPath.Data(),ios::in | ios::binary|ios::ate);
- Int_t kBytes = (Int_t)in.tellg();
- printf("Size: %d \n",kBytes);
- TNamed *fn = 0;
- if(in.good()){
- char* memblock = new char [kBytes];
- in.seekg (0, ios::beg);
- in.read (memblock, kBytes);
- in.close();
- TString fData(memblock,kBytes);
- fn = new TNamed(pName,fData);
- printf("fData Size: %d \n",fData.Sizeof());
- printf("pName Size: %d \n",pName.Sizeof());
- printf("fn Size: %d \n",fn->Sizeof());
- delete[] memblock;
- }
- else{
- AliInfo(Form("Could not Open %s\n",fPath.Data()));
- }
-
- return fn;
-}
-
-void AliReconstruction::TNamedToFile(TTree* fTree, TString pName){
- // This is not really needed in AliReconstruction at the moment
- // but can serve as a template
-
- TList *fList = fTree->GetUserInfo();
- TNamed *fn = (TNamed*)fList->FindObject(pName.Data());
- printf("fn Size: %d \n",fn->Sizeof());
-
- TString fTmp(fn->GetName()); // to be 100% sure in principle pName also works
- const char* cdata = fn->GetTitle();
- printf("fTmp Size %d\n",fTmp.Sizeof());
-
- int size = fn->Sizeof()-fTmp.Sizeof()-sizeof(UChar_t)-sizeof(Int_t); // see dfinition of TString::SizeOf()...
- printf("calculated size %d\n",size);
- ofstream out(pName.Data(),ios::out | ios::binary);
- out.write(cdata,size);
- out.close();
-
-}
-
//_____________________________________________________________________________
void AliReconstruction::CheckQA()
{
{
// return the detector index corresponding to detector
Int_t index = -1 ;
- for (index = 0; index < fgkNDetectors ; index++) {
+ for (index = 0; index < kNDetectors ; index++) {
if ( strcmp(detector, fgkDetectorName[index]) == 0 )
break ;
}
// Return: kTRUE if all operations have been done properly, kFALSE otherwise
//
Bool_t ret=kFALSE;
- //for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ //for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
for (Int_t iDet = 0; iDet < 1; iDet++) { // for the time being only ITS
//if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
if(fTracker[iDet]) {
Bool_t isOK = kTRUE;
TString detStr = fLoadCDB;
- for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+ for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;