115 #include <TGeoGlobalMagField.h> 116 #include <TGeoManager.h> 118 #include <TLorentzVector.h> 120 #include <TObjArray.h> 121 #include <TPRegexp.h> 122 #include <TParameter.h> 123 #include <TPluginManager.h> 125 #include <TProofOutputFile.h> 128 #include <THashTable.h> 130 #include <TMessage.h> 133 #include <THashList.h> 175 #include "AliRawVEvent.h" 176 #include "AliRawEventHeaderBase.h" 177 #include "AliRawHLTManager.h" 178 #include "AliRawReaderDate.h" 179 #include "AliRawReaderFile.h" 180 #include "AliRawReaderRoot.h" 204 #include "ARVersion.h" 207 #include <RVersion.h> 210 #include <sys/resource.h> 219 "HMPID",
"EMCAL",
"MUON",
"FMD",
"ZDC",
"PMD",
"T0",
"VZERO",
"ACORDE",
"AD",
"FIT",
"MFT",
"HLT"};
505 for (Int_t i = 0; i < rec.
fOptions.GetEntriesFast(); i++) {
520 for (Int_t i = 0; i < rec.
fSpecCDBUri.GetEntriesFast(); i++) {
542 if(&rec ==
this)
return *
this;
595 for (Int_t i = 0; i < rec.
fOptions.GetEntriesFast(); i++) {
752 qam->SetSaveData(kTRUE);
755 qam->SetWriteExpert() ;
757 if (qam->IsDefaultStorageSet()) {
758 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
759 AliWarning(
"Default QA reference storage has been already set !");
760 AliWarning(Form(
"Ignoring the default storage declared in AliReconstruction: %s",
fQARefUri.Data()));
761 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
762 fQARefUri = qam->GetDefaultStorage()->GetURI();
765 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
766 AliDebug(2, Form(
"Default QA reference storage is set to: %s",
fQARefUri.Data()));
767 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
770 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
771 AliWarning(
"Default QA refeference storage not yet set !!!!");
773 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
793 Bool_t sameCycle = kFALSE ;
795 AliInfo(Form(
"Initializing the global QA data maker"));
833 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
834 AliWarning(
"Default CDB storage has been already set !");
835 AliWarning(Form(
"Ignoring the default storage declared in AliReconstruction: %s",
fCDBUri.Data()));
836 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
842 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
843 AliDebug(2, Form(
"Default CDB storage is set to: %s",
fCDBUri.Data()));
844 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
848 fCDBUri=
"local://$ALICE_ROOT/OCDB";
849 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
850 AliWarning(
"Default CDB storage not yet set !!!!");
852 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
856 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
857 AliWarning(
"Default storage will be set after setting the Run Number!!!");
858 AliWarning(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
863 for (Int_t i = 0; i <
fSpecCDBUri.GetEntriesFast(); i++) {
866 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
867 AliDebug(2, Form(
"Specific CDB storage for %s is set to: %s",obj->GetName(),obj->GetTitle()));
868 AliDebug(2,
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
877 AliFatal(
"Setting CDB snapshot mode failed.");
910 aPath.
SetPath(Form(
"%s/*", calibType));
911 AliInfo(Form(
"Path for specific storage set to %s", aPath.
GetPath().Data()));
916 AliError(Form(
"Not a valid path or detector: %s", calibType));
947 TString newent = cdbpath;
948 if (newent.IsNull())
return;
951 while ((cdbent=(TNamed*)nextit())) {
952 TString str = cdbent->GetName();
954 AliInfo(Form(
"%s is already in the list to check",cdbpath));
967 TString newent = cdbpath;
968 if (newent.IsNull())
return;
971 while ((cdbent=(TNamed*)nextit())) {
972 TString str = cdbent->GetName();
974 AliInfo(Form(
"Removing %s from the list to check",cdbpath));
980 AliInfo(Form(
"%s is not in the list to check",cdbpath));
999 AliWarning(
"Run number is taken from raw-event header! Ignoring settings in AliCDBManager!");
1007 AliWarning(
"No raw-data events are found ! Using settings in AliCDBManager !");
1010 AliWarning(
"Neither raw events nor settings in AliCDBManager are found !");
1030 AliError(
"Neither run-loader header nor RawReader objects are found !");
1073 TString detStr = detectors;
1074 TString loadAlObjsListOfDets =
"";
1076 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
1083 loadAlObjsListOfDets +=
" ";
1088 loadAlObjsListOfDets.Prepend(
"GRP ");
1097 AliError(
"The misalignment of one or more volumes failed!" 1098 "Compare the list of simulated detectors and the list of detector alignment data!");
1103 AliError(
"Can't apply the misalignment! gGeoManager doesn't exist or it is still opened!");
1151 TObject* obj =
fOptions.FindObject(detector);
1153 fOptions.Add(
new TNamed(detector, option));
1163 if(!strcmp(detector,
"GRP")) {
1169 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
1188 TMap* m =
dynamic_cast<TMap*
>(entry->
GetObject());
1191 AliInfo(
"Found a TMap in GRP/GRP/Data, converting it into an AliGRPObject");
1198 AliInfo(
"Found an AliGRPObject in GRP/GRP/Data, reading it");
1213 AliError(
"No GRP entry found in OCDB!");
1219 AliError(
"GRP/GRP/Data entry: missing value for the LHC state ! Using UNKNOWN");
1220 lhcState =
"UNKNOWN";
1225 AliError(
"GRP/GRP/Data entry: missing value for the beam type ! Using UNKNOWN");
1226 beamType =
"UNKNOWN";
1231 AliError(
"GRP/GRP/Data entry: missing value for the beam energy ! Using 0");
1237 AliError(
"GRP/GRP/Data entry: missing value for the run type ! Using UNKNOWN");
1238 runType =
"UNKNOWN";
1243 AliError(
"GRP/GRP/Data entry: missing value for the detector mask ! Using 1074790399");
1244 activeDetectors = 1074790399;
1246 AliDebug(1, Form(
"activeDetectors = %d", activeDetectors));
1253 if (activeDetectors) {
1254 UInt_t detMask = activeDetectors;
1274 AliInfo(
"SPD,SDD,SSD is not in the list of active detectors. Vertexer and Trackleter are switched off.");
1281 AliInfo(
"CTP is not in the list of active detectors. CTP data reading switched off.");
1287 AliInfo(
"===================================================================================");
1292 AliInfo(Form(
"CDB and reconstruction parameters are loaded for detectors: %s",
fLoadCDB.Data()));
1293 AliInfo(
"===================================================================================");
1296 if ( TGeoGlobalMagField::Instance()->IsLocked() ) {
1298 AliInfo(
"ExpertMode!!! GRP information will be ignored !");
1299 AliInfo(
"ExpertMode!!! Running with the externally locked B field !");
1302 AliInfo(
"Destroying existing B field instance!");
1303 delete TGeoGlobalMagField::Instance();
1306 if ( !TGeoGlobalMagField::Instance()->IsLocked() ) {
1312 AliError(
"GRP/GRP/Data entry: missing value for the L3 current !");
1318 AliError(
"GRP/GRP/Data entry: missing value for the L3 polarity !");
1325 AliError(
"GRP/GRP/Data entry: missing value for the dipole current !");
1331 AliError(
"GRP/GRP/Data entry: missing value for the dipole polarity !");
1344 TMath::Abs(diCurrent) * (diPolarity ? -1:1),
1345 polConvention,uniformB,beamEnergy, beamType.Data(),az0,az1);
1347 TGeoGlobalMagField::Instance()->SetField( fld );
1348 TGeoGlobalMagField::Instance()->Lock();
1349 AliInfo(
"Running with the B field constructed out of GRP !");
1351 else AliFatal(
"Failed to create a B field map !");
1353 else AliFatal(
"B field is neither set nor constructed from GRP ! Exitig...");
1361 AliError(
"No SPD diamond profile found in OCDB!");
1368 AliError(
"No diamond profile found in OCDB!");
1375 AliError(
"No TPC diamond profile found in OCDB!");
1395 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
1415 AliWarning(
"Can not get list of cosmic triggers from OCDB! Cosmic event specie will rely on aliases if defined");
1433 AliInfo(
"Found an AliTriggerRunScalers in GRP/CTP/Scalers, reading it");
1448 if (!entry)
return kFALSE;
1450 AliInfo(
"Found an AliCTPTimeParams in GRP/CTP/CTPtiming, reading it");
1455 if (!entry2)
return kFALSE;
1457 AliInfo(
"Found an AliCTPTimeParams in GRP/CTP/TimeAlign, reading it");
1471 if (!entry || !entryCTP) {
1472 AliError(Form(
"Failed to extract CDB objects GRP/GRP/LHCData: %p or GRP/CTP/Config: %p",entry,entryCTP));
1476 enum {kA,kB,kC,kE,kNMasks};
1483 masks.SetOwner(kFALSE);
1486 TString trName = trClass->GetName();
1487 int ind = trName.Index(
"-");
1488 if (ind<1)
continue;
1490 trName = trName.Data() + ind;
1492 if (!bcMask)
continue;
1494 if (trName.BeginsWith(
"-A-")) which |= 0x1<<kA;
1495 else if (trName.BeginsWith(
"-B-")) which |= 0x1<<kB;
1496 else if (trName.BeginsWith(
"-C-")) which |= 0x1<<kC;
1497 else if (trName.BeginsWith(
"-E-")) which |= 0x1<<kE;
1498 else if (trName.BeginsWith(
"-AC-")) which |= (0x1<<kA) | (0x1<<kC);
1499 else if (trName.BeginsWith(
"-CA-")) which |= (0x1<<kA) | (0x1<<kC);
1500 else {
AliWarning(Form(
"Unknown trigger type %s\n",trClass->GetName()));
continue;}
1502 for (
int ip=kNMasks;ip--;) {
1503 if ( !(which&(0x1<<ip)) || masks[ip] )
continue;
1504 masks[ip] = (TObject*)bcMask;
1507 if (nFound==kNMasks)
break;
1510 AliInfo(
"Reading mean bunch intensities from GRP/GRP/LHCData");
1513 for (
int ib=2;ib--;) {
1518 AliInfo(Form(
"Mean intensity for beam %d: Interacting:%.2e Non-Interacting:%.2e",ib,intI,intNI));
1533 if (GetAbort() != TSelector::kContinue)
return kFALSE;
1535 TChain *
chain = NULL;
1542 gProof->Exec(
"gEnv->SetValue(\"Proof.SocketActivityTimeout\",-1)", kTRUE);
1545 gProof->Exec(
"TGrid::Connect(\"alien://\")",kTRUE);
1547 TMessage::EnableSchemaEvolutionForAll(kTRUE);
1548 gProof->Exec(
"TMessage::EnableSchemaEvolutionForAll(kTRUE)",kTRUE);
1550 gProof->AddInput(
this);
1554 gProof->SetParameter(
"PROOF_MaxSlavesPerNode", 9999);
1556 chain->Process(
"AliReconstruction",
"",nEntries,
fFirstEvent);
1564 if (GetAbort() != TSelector::kContinue)
return kFALSE;
1566 if (GetAbort() != TSelector::kContinue)
return kFALSE;
1568 AliInfo(
"Starting looping over events");
1570 while ((iEvent < fRunLoader->GetNumberOfEvents()) ||
1576 Abort(
"ProcessEvent",TSelector::kAbortFile);
1582 if (!iEvent)
AliWarning(
"No events passed trigger selection");
1584 if (GetAbort() != TSelector::kContinue)
return kFALSE;
1586 if (GetAbort() != TSelector::kContinue)
return kFALSE;
1604 AliInfo(
"Reconstruction will run over digits");
1607 AliFatal(
"Can not create raw-data reader ! Exiting...");
1644 Abort(
"SetRunNumberFromData", TSelector::kAbortProcess);
1674 geom +=
"/geometry.root";
1677 Abort(
"LoadGeometry", TSelector::kAbortProcess);
1683 Abort(
"CheckSymNamesLUT", TSelector::kAbortProcess);
1689 Bool_t toCDBSnapshot=kFALSE;
1690 TString snapshotFileOut(
"");
1692 if(TString(getenv(
"OCDB_SNAPSHOT_CREATE")) == TString(
"kTRUE")){
1693 toCDBSnapshot=kTRUE;
1695 TString snapshotFile(getenv(
"OCDB_SNAPSHOT_FILENAME"));
1696 if(!(snapshotFile.IsNull() || snapshotFile.IsWhitespace()))
1697 snapshotFileOut = snapshotFile;
1699 snapshotFileOut=
"OCDB.root";
1703 if (!toCDBSnapshot) {
1705 Abort(
"MisalignGeometry", TSelector::kAbortProcess);
1710 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
1716 detAlignPath +=
"/Align/Data";
1725 if(!toCDBSnapshot) {
1726 if(cdbCache->Contains(
"GRP/Geometry/Data"))
1733 Abort(
"InitGRP", TSelector::kAbortProcess);
1738 if(cdbCache->Contains(
"GRP/Calib/CosmicTriggers"))
1743 Abort(
"LoadCDB", TSelector::kAbortProcess);
1750 Abort(
"LoadTriggerScalersCDB", TSelector::kAbortProcess);
1756 Abort(
"LoadCTPTimeParamsCDB", TSelector::kAbortProcess);
1762 Abort(
"ReadIntensityInfoCDB", TSelector::kAbortProcess);
1769 AliWarning(
"Not all detectors have correct RecoParam objects initialized");
1779 if (fInput && gProof) {
1780 if (reco) *reco = *
this;
1787 AliMagF *magFieldMap = (
AliMagF*)TGeoGlobalMagField::Instance()->GetField();
1788 magFieldMap->SetName(
"MagneticFieldMap");
1789 gProof->AddInputData(magFieldMap,kTRUE);
1805 TProofOutputFile *outProofFile = NULL;
1812 if (TGeoManager *tgeo = (TGeoManager*)fInput->FindObject(
"Geometry")) {
1816 if (TMap *entryCache = (TMap*)fInput->FindObject(
"CDBEntryCache")) {
1818 if (TProof::GetParameter(fInput,
"RunNumber",runNumber) == 0) {
1825 if (
AliMagF *map = (
AliMagF*)fInput->FindObject(
"MagneticFieldMap")) {
1828 Abort(
"AliMagF::LoadParameterization", TSelector::kAbortProcess);
1831 TGeoGlobalMagField::Instance()->SetField(newMap);
1832 TGeoGlobalMagField::Instance()->Lock();
1837 if (
fAnalysis)
AliInfo(
"==== Analysis manager retrieved from input list ====");
1839 if (TNamed *outputFileName = (TNamed*)fInput->FindObject(
"PROOF_OUTPUTFILE"))
1841 if (TNamed *outputLocation = (TNamed*)fInput->FindObject(
"PROOF_OUTPUTFILE_LOCATION"))
1843 if (fInput->FindObject(
"PROOF_OUTPUTFILE_DATASET"))
1845 if (TNamed *archiveList = (TNamed*)fInput->FindObject(
"PROOF_OUTPUTFILE_ARCHIVE"))
1858 fOutput->Add(outProofFile);
1873 else AliInfo(Form(
"==== Analysis manager <%s> produced by analysis macro <%s> ====",
1880 Abort(
"InitRunLoader", TSelector::kAbortProcess);
1891 Abort(
"CreateTrackers", TSelector::kAbortProcess);
1897 if (!outProofFile) {
1899 ffile->SetCompressionLevel(2);
1900 if (!
ffile->IsOpen()) {
1901 Abort(
"OpenESDFile", TSelector::kAbortProcess);
1906 AliInfo(Form(
"Opening output PROOF file: %s/%s",
1907 outProofFile->GetDir(), outProofFile->GetFileName()));
1908 if (!(
ffile = outProofFile->OpenFile(
"RECREATE"))) {
1909 Abort(Form(
"Problems opening output PROOF file: %s/%s",
1910 outProofFile->GetDir(), outProofFile->GetFileName()),
1911 TSelector::kAbortProcess);
1916 ftree =
new TTree(
"esdTree",
"Tree with ESD objects");
1926 ftreeF =
new TTree(
"esdFriendTree",
"Tree with ESD Friend objects");
1932 ftreeF->Branch(
"ESDfriend.",
"AliESDfriend", &
fesdf);
1949 AliError(Form(
"Error getting \"HLT/Calib/esdLayout\""));
1961 AliError(Form(
"error setting hltEsd layout from \"HLT/Calib/esdLayout\": invalid object type"));
1968 AliInfo(
"HLT ESD tree writing is disabled");
1972 gSystem->GetProcInfo(&procInfo);
1973 AliInfo(Form(
"Current memory usage %ld %ld", procInfo.fMemResident, procInfo.fMemVirtual));
1985 Abort(
"InitPlaneEff", TSelector::kAbortProcess);
1989 if (strcmp(gProgName,
"alieve") == 0)
1994 AliError(
"Analysis manager used in reconstruction should use AliRecoInputHandler - \ 1995 \n ->Replacing with AliRecoInputHandler instance.");
2018 AliInfo(
"Externaly supplied MCEventHandler will be used");
2021 Abort(
"Failed to initialize MCEventHandler", TSelector::kAbortProcess);
2043 TTree *currTree =
fChain->GetTree();
2044 AliRawVEvent *
event = NULL;
2045 currTree->SetBranchAddress(
"rawevent",&event);
2046 currTree->GetEntry(entry);
2047 fRawReader =
new AliRawReaderRoot(event,entry);
2055 if (!fStatus)
Abort(
"ProcessEvent",TSelector::kAbortFile);
2066 AliError(
"The input tree is not found!");
2079 static Long_t oldMres=0;
2080 static Long_t oldMvir=0;
2081 static Float_t oldCPU=0;
2082 static Long_t aveDMres=0;
2083 static Long_t aveDMvir=0;
2084 static Float_t aveDCPU=0;
2140 gSystem->GetProcInfo(&procInfo);
2141 oldMres=procInfo.fMemResident;
2142 oldMvir=procInfo.fMemVirtual;
2143 oldCPU=procInfo.fCpuUser+procInfo.fCpuSys;
2153 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2219 for (
int ib=2;ib--;)
for (
int it=2;it--;) {
2233 AliMagF* fld = (
AliMagF*)TGeoGlobalMagField::Instance()->GetField();
2252 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2285 if (detectors.Contains(
"ALL")) {
2286 AliFatal(
"Keyword 'ALL' needs to be replaced by the full list of detectors in " 2287 "fRunLocalReconstruction. This should have been done by the framework");
2289 detectors.ReplaceAll(
"HLT",
"");
2362 if (detectors.Contains(
"ALL")) {
2363 AliFatal(
"Keyword 'ALL' needs to be replaced by the full list of detectors in " 2364 "fFillESD. This should have been done by the framework");
2367 detectors.ReplaceAll(
"HLT",
"");
2379 const Double_t kRadius = 2.8;
2382 UShort_t selectedIdx[ntracks];
2384 for (Int_t itrack=0; itrack<ntracks; itrack++){
2385 const Double_t kMaxStep = 5;
2389 if (!track)
continue;
2399 Int_t n=trkArray.GetEntriesFast();
2400 selectedIdx[n]=track->
GetID();
2401 trkArray.AddLast(tpcTrack);
2409 Double_t x[3]; track->
GetXYZ(x);
2421 if(vtitle.Contains(
"cosmics")) {
2422 runVertexFinderTracks=kFALSE;
2426 if (runVertexFinderTracks) {
2431 Bool_t constrSPD=kFALSE;
2434 Double_t *cutsVertexer =
new Double_t[nCutsVertexer];
2437 delete [] cutsVertexer; cutsVertexer = NULL;
2451 AliInfo(
"No TPC clusters: VertexerTracks will run with ITSpureSA tracks");
2458 TString title=pvtx->GetTitle();
2459 title.Append(
"SPD");
2460 pvtx->SetTitle(title);
2464 for (Int_t i=0; i<ntracks; i++) {
2466 Double_t x[3]; t->
GetXYZ(x);
2471 delete pvtx; pvtx=NULL;
2481 Double_t *cutsVertexer =
new Double_t[nCutsVertexer];
2484 delete [] cutsVertexer; cutsVertexer = NULL;
2493 for (Int_t i=0; i<ntracks; i++) {
2495 Double_t x[3]; t->
GetXYZ(x);
2500 delete pvtx; pvtx=NULL;
2515 Double_t cutsV0vertexer[nCutsV0vertexer];
2517 vtxer.
SetCuts(cutsV0vertexer);
2521 AliInfo(
"V0 selection hypotheses:");
2534 Double_t cutsCascadeVertexer[nCutsCascadeVertexer];
2536 cvtxer.
SetCuts(cutsCascadeVertexer);
2603 if (pHLTSrc && pHLTTgt) {
2604 pHLTSrc->Copy(*pHLTTgt);
2622 nbf =
ftree->Fill();
2624 nbf =
ftree->GetZipBytes();
2625 if (nbf>0) nbf = -nbf;
2626 else nbf =
ftree->GetEntries();
2627 ftree->SetAutoFlush(nbf);
2628 AliInfo(Form(
"Calling ftree->SetAutoFlush(%lld) | W:%lld T:%lld Z:%lld",
2640 ftree->AutoSave(
"SaveSelf");
2645 AliInfo(
"HLT ESD online prescaling flag is ON: disabling offline prescaling");
2651 AliInfo(
"HLT ESD for this event will be empty");
2657 if (nbf>0) nbf = -nbf;
2660 AliInfo(Form(
"Calling fhlttree->SetAutoFlush(%lld) | W:%lld T:%lld Z:%lld",
2665 gSystem->GetProcInfo(&procInfo);
2666 Long_t dMres=(procInfo.fMemResident-oldMres)/1024;
2667 Long_t dMvir=(procInfo.fMemVirtual-oldMvir)/1024;
2668 Float_t dCPU=procInfo.fCpuUser+procInfo.fCpuSys-oldCPU;
2669 aveDMres+=(dMres-aveDMres)/(iEvent-
fFirstEvent+1);
2670 aveDMvir+=(dMvir-aveDMvir)/(iEvent-
fFirstEvent+1);
2672 AliInfo(Form(
"======================= End Event %d: Res %ld(%3ld <%3ld>) Vir %ld(%3ld <%3ld>) CPU %5.2f <%5.2f> ===================",
2673 iEvent, procInfo.fMemResident/1024, dMres, aveDMres, procInfo.fMemVirtual/1024, dMvir, aveDMvir, dCPU, aveDCPU));
2674 oldMres=procInfo.fMemResident;
2675 oldMvir=procInfo.fMemVirtual;
2676 oldCPU=procInfo.fCpuUser+procInfo.fCpuSys;
2701 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2705 AliInfo(
"======================= End Event ===================");
2708 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2746 TMap *cdbMapCopy =
new TMap();
2747 cdbMapCopy->SetName(
"cdbMap");
2748 TList *cdbListCopy =
new TList();
2749 cdbListCopy->SetName(
"cdbList");
2753 ftree->GetUserInfo()->Add(cdbMapCopy);
2754 ftree->GetUserInfo()->Add(cdbListCopy);
2757 TString sVersion(
"aliroot ");
2758 sVersion += ALIROOT_VERSION;
2760 sVersion += ALIROOT_REVISION;
2761 sVersion +=
"; root ";
2762 #ifdef ROOT_SVN_BRANCH 2763 sVersion += ROOT_SVN_BRANCH;
2764 #elif defined(ROOT_GIT_BRANCH) 2765 sVersion += ROOT_GIT_BRANCH;
2770 #ifdef ROOT_SVN_REVSION 2771 sVersion += ROOT_SVN_REVISION;
2772 #elif defined(ROOT_GIT_COMMIT) 2773 sVersion += ROOT_GIT_COMMIT;
2777 sVersion +=
"; metadata ";
2778 sVersion += getenv(
"PRODUCTION_METADATA");
2781 TNamed * alirootVersion =
new TNamed(
"alirootVersion",sVersion.Data());
2782 ftree->GetUserInfo()->Add(alirootVersion);
2787 ftree->Write(
ftree->GetName(),TObject::kOverwrite);
2797 AliWarning(
"Finish PlaneEff evaluation failed");
2800 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2811 TString qaOutputFile(Form(
"%sMerged.%s.Data.root",
2814 TProofOutputFile *qaProofFile =
new TProofOutputFile(Form(
"Merged.%s.Data.root",
2816 qaProofFile->SetOutputFileName(qaOutputFile.Data());
2818 fOutput->Add(qaProofFile);
2819 MergeQA(qaProofFile->GetFileName());
2838 fOutput->Add(zipProofFile);
2840 fileList.ReplaceAll(
",",
" ");
2842 #if ROOT_SVN_REVISION >= 30174 2843 command.Form(
"zip -n root %s/%s %s",zipProofFile->GetDir(kTRUE),zipProofFile->GetFileName(),fileList.Data());
2845 command.Form(
"zip -n root %s/%s %s",zipProofFile->GetDir(),zipProofFile->GetFileName(),fileList.Data());
2847 AliInfo(Form(
"Executing: %s",command.Data()));
2848 gSystem->Exec(command.Data());
2864 delete esdtagCreator;
2876 static Int_t eventNr=0;
2879 TString detStr = detectors;
2885 if (reconstructor) {
2888 AliInfo(
"running reconstruction for HLT");
2890 AliInfo(
"reconstructor->Reconstruct(fRawReader, NULL)");
2894 AliInfo(
"reconstructor->Reconstruct(dummy, NULL)");
2904 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
2908 if (!reconstructor)
continue;
2916 AliInfo(Form(
"converting raw data digits into root objects for %s",
2923 TTree* digitsTree = loader->
TreeD();
2933 AliDebug(1,
"Cleaning Rec Points");
2935 AliDebug(1,
"Making Rec Points Container");
2937 TTree* clustersTree = loader->
TreeR();
2944 TTree* digitsTree = loader->
TreeD();
2945 AliDebug(1, Form(
"Digits Tree = %p",digitsTree));
2953 reconstructor->
Reconstruct(digitsTree, clustersTree);
2970 if ((detStr.CompareTo(
"ALL") != 0) && !detStr.IsNull()) {
2971 AliError(Form(
"the following detectors were not found: %s",
2986 Double_t vtxPos[3] = {0, 0, 0};
2987 Double_t vtxErr[3] = {0.0, 0.0, 0.0};
3006 AliInfo(
"running the SPD Trackleter for Plane Efficiency Evaluation");
3012 AliError(
"Can't get the ITS cluster tree");
3019 AliWarning(
"AliITSTrackleterSPDEff Clusters2Tracks failed");
3039 if (!vertexer)
return kFALSE;
3041 AliInfo(Form(
"running the ITS vertex finder: %s",vertexer->ClassName()));
3051 AliError(
"Can't get the ITS cluster tree");
3056 AliError(
"Can't get the ITS loader");
3061 vertex->SetName(
"default");
3064 vertex->SetName(
"reconstructed");
3074 Int_t novertices = 0;
3084 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3102 if (!trackleter)
return kFALSE;
3104 AliInfo(Form(
"running the ITS multiplicity finder: %s",trackleter->ClassName()));
3115 AliError(
"Can't get the ITS cluster tree");
3120 AliError(
"Can't get the ITS loader");
3143 if (!reconstructor)
return kFALSE;
3147 AliDebug(1, Form(
"%s tracking", detName.Data()));
3150 AliWarning(Form(
"couldn't create a tracker for %s", detName.Data()));
3192 if (!reconstructor)
return kFALSE;
3195 AliDebug(1, Form(
"%s tracking for muon tracks", detName.Data()));
3198 AliWarning(Form(
"couldn't create a Muon tracker for %s", detName.Data()));
3226 static Int_t eventNr=0;
3236 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3251 for (Int_t iDet = 1; iDet >= 0; iDet--) {
3282 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3308 if ( elem && (! elem->At(0)) ) {
3315 if (
fTracker[iDet]->PropagateBack(esd) != 0) {
3344 for (Int_t iDet = 2; iDet >= 0; iDet--) {
3356 if ( elem && (! elem->At(0)) ) {
3363 if (
fTracker[iDet]->RefitInward(esd) != 0) {
3368 if (
fTracker[iDet]->PostProcess(esd) != 0) {
3382 for (Int_t iDet = 3; iDet >= 0; iDet--) {
3410 (Form(
"Number of ESD tracks and V0s before cleaning: %d %d",nTracks,nV0s));
3412 Bool_t rc=esd->
Clean(&tracks2remove,grpRecoParam);
3414 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3418 tracks2remove.Delete();
3423 (Form(
"Number of ESD tracks and V0s after cleaning %d %d",nTracks,nV0s));
3434 static Int_t eventNr=0;
3435 TString detStr = detectors;
3438 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3441 if (!reconstructor)
continue;
3443 TTree* clustersTree = NULL;
3447 if (!clustersTree) {
3448 AliError(Form(
"Can't get the %s clusters tree",
3456 TTree* digitsTree = NULL;
3461 AliError(Form(
"Can't get the %s digits tree",
3466 reconstructor->
FillESD(digitsTree, clustersTree, esd);
3475 if ((detStr.CompareTo(
"ALL") != 0) && !detStr.IsNull()) {
3476 AliError(Form(
"the following detectors were not found: %s",
3494 AliInfo(
"Filling trigger information into the ESD");
3498 if (!input.
Next()) {
3499 AliWarning(
"No valid CTP (trigger) DDL raw data is found ! The trigger info is taken from the event header!");
3503 AliError(Form(
"Invalid trigger pattern found in CTP raw-data: %llx %llx",
3506 AliError(Form(
"Invalid trigger pattern found in CTP raw-data Next50: %llx %llx",
3509 AliError(Form(
"Invalid orbit id found in CTP raw-data: %x %x",
3512 AliError(Form(
"Invalid bunch-crossing id found in CTP raw-data: %x %x",
3520 for(Int_t i=0 ; i<input.
GetNIRs() ; i++ ) {
3543 for(Int_t i=0;i<50;i++){
3546 if(scalesd)esdheader->SetTriggerScalersRecord(scalesd);
3549 for(Int_t i=0;i<50;i++){
3552 if(scalesd)esdheader->SetTriggerScalersRecord(scalesd);
3557 if (scalrecEvent) esdheader->SetTriggerScalersDeltaEvent(scalrecEvent);
3558 if (scalrecRun) esdheader->SetTriggerScalersDeltaRun(scalrecRun);
3572 AliInfo(
"Filling information from RawReader Header");
3591 if (!headerMC || !esd)
return kFALSE;
3593 AliInfo(
"Filling information from MC Header");
3607 if ((detectors.CompareTo(
"ALL") == 0) ||
3608 detectors.BeginsWith(
"ALL ") ||
3609 detectors.EndsWith(
" ALL") ||
3610 detectors.Contains(
" ALL ")) {
3616 Bool_t result = kFALSE;
3617 if ((detectors.CompareTo(detName) == 0) ||
3618 detectors.BeginsWith(detName+
" ") ||
3619 detectors.EndsWith(
" "+detName) ||
3620 detectors.Contains(
" "+detName+
" ")) {
3621 detectors.ReplaceAll(detName,
"");
3626 while (detectors.Contains(
" ")) detectors.ReplaceAll(
" ",
" ");
3627 while (detectors.BeginsWith(
" ")) detectors.Remove(0, 1);
3628 while (detectors.EndsWith(
" ")) detectors.Remove(detectors.Length()-1, 1);
3649 AliInfo(
"Embedding mode autodetected");
3651 AliInfo(
"MCEvent handler was set externally, skip internal initialization");
3666 TString libs = gSystem->GetLibraries();
3667 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3669 if (libs.Contains(
"lib" + detName +
"base.so"))
continue;
3670 gSystem->Load(
"lib" + detName +
"base");
3696 AliError(Form(
"could not create run loader in file %s",
3729 TPluginManager* pluginManager =
gROOT->GetPluginManager();
3731 TString recName =
"Ali" + detName +
"Reconstructor";
3737 TPluginHandler* pluginHandler =
3738 pluginManager->FindHandler(
"AliReconstructor", detName);
3740 if (!pluginHandler) {
3741 AliDebug(1, Form(
"defining plugin for %s", recName.Data()));
3742 TString libs = gSystem->GetLibraries();
3743 if (libs.Contains(
"lib" + detName +
"base.so") ||
3744 (gSystem->Load(
"lib" + detName +
"base") >= 0)) {
3745 pluginManager->AddHandler(
"AliReconstructor", detName,
3746 recName, detName +
"rec", recName +
"()");
3748 pluginManager->AddHandler(
"AliReconstructor", detName,
3749 recName, detName, recName +
"()");
3751 pluginHandler = pluginManager->FindHandler(
"AliReconstructor", detName);
3753 if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
3759 if(reconstructor)
delete reconstructor;
3760 TClass *cl =
new TClass(Form(
"Ali%sUpgradeReconstructor",
fgkDetectorName[iDet]));
3764 if (reconstructor) {
3765 TObject* obj =
fOptions.FindObject(detName.Data());
3766 if (obj) reconstructor->
SetOption(obj->GetTitle());
3769 reconstructor->
Init();
3774 if (detName !=
"HLT") {
3782 pluginManager->FindHandler(
"AliLoader", detName);
3784 if (!pluginHandler) {
3785 TString loaderName =
"Ali" + detName +
"Loader";
3786 AliDebug(1, Form(
"defining plugin for %s", loaderName.Data()));
3787 pluginManager->AddHandler(
"AliLoader", detName,
3788 loaderName, detName +
"base",
3789 loaderName +
"(const char*, TFolder*)");
3790 pluginHandler = pluginManager->FindHandler(
"AliLoader", detName);
3792 if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
3794 (
AliLoader*) pluginHandler->ExecPlugin(2, detName.Data(),
3801 AliWarning(Form(
"couldn't get loader for %s", detName.Data()));
3806 if (gFile && !gFile->IsWritable()) gFile->ReOpen(
"UPDATE");
3814 if (reconstructor) {
3819 return reconstructor;
3836 AliWarning(
"couldn't create a vertexer for ITS");
3856 AliWarning(
"ITS is not in reconstruction, switching off RunMultFinder");
3869 TString detStr = detectors;
3870 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3873 if (!reconstructor)
continue;
3875 if (detName ==
"MUON") {
3879 if (detName ==
"MFT") {
3885 if (!
fTracker[iDet] && (iDet < 7)) {
3886 AliWarning(Form(
"couldn't create a tracker for %s", detName.Data()));
3899 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
3945 AliInfo(
"Will not write alignment data since the friends are not stored");
3949 for (Int_t itrack = 0; itrack < ntracks; itrack++)
3955 for (Int_t i=0; i<200; ++i) idx[i] = -1;
3956 for (Int_t iDet = 5; iDet >= 0; iDet--) {
3961 for (Int_t i=6; i<12; i++) if(idx[i] >= 0) nsp++;
3970 for (Int_t iDet = 5; iDet >= 0; iDet--) {
3972 if (!tracker)
continue;
3976 for (Int_t i=6; i<12; i++) if(idx[i] >= 0) nspdet++;
3978 if (nspdet <= 0)
continue;
3982 while (isp2 < nspdet) {
3983 Bool_t isvalid=kTRUE;
3985 Int_t index=idx[isp++];
3986 if (index < 0)
continue;
3998 if (!isvalid)
continue;
4000 sp->
AddPoint(isptrack,&p); isptrack++;
4018 for(Int_t i = 0; i <
fRawReader->GetNumberOfErrorLogs(); i++) {
4095 for (Int_t iDet = 0; iDet < 1; iDet++) {
4099 TString name=planeeff->GetName();
4102 ret=(Bool_t)planeeff->Write();
4105 TString hname=planeeff->GetName();
4106 hname+=
"Histo.root";
4112 TString name=
"AliITSPlaneEffSPDtracklet.root";
4114 ret=(Bool_t)planeeff->Write();
4141 if (itsReconstructor) {
4145 AliInfo(
"Trackleter for SPD has been created");
4163 TString macroStr(getenv(
"ALIEVE_ONLINE_MACRO"));
4165 if (macroStr.IsNull())
4166 macroStr.Form(
"%s/EVE/macros/alieve_online.C",gSystem->ExpandPathName(
"$ALICE_ROOT"));
4168 AliInfo(Form(
"Loading AliEVE macro: %s",macroStr.Data()));
4170 if (
gROOT->LoadMacro(macroStr.Data()) != 0)
return kFALSE;
4172 gROOT->ProcessLine(
"if (!AliEveEventManager::GetMaster()){new AliEveEventManager();AliEveEventManager::GetMaster()->AddNewEventCommand(\"alieve_online_on_new_event()\");gEve->AddEvent(AliEveEventManager::GetMaster());};");
4173 gROOT->ProcessLine(
"alieve_online_init()");
4187 gROOT->ProcessLine(Form(
"AliEveEventManager::GetMaster()->SetEvent((AliRunLoader*)%p,(AliRawReader*)%p,(AliESDEvent*)%p,(AliESDfriend*)%p);",
fRunLoader,
fRawReader,
fesd,
fesdf));
4198 if (!detAndAction.Contains(
":")) {
4199 AliError( Form(
"%s is a wrong syntax, use \"DetectorList:ActionList\" \n", detAndAction.Data()) ) ;
4203 Int_t colon = detAndAction.Index(
":") ;
4205 fQATasks = detAndAction(colon+1, detAndAction.Length() ) ;
4215 if (
fQATasks.Contains(
"RECPOINT") )
4221 AliInfo(
"No QA requested\n") ;
4231 AliInfo( Form(
"QA will be done on \"%s\" for \"%s\"\n",
fQADetectors.Data(), tempo.Data()) ) ;
4242 Bool_t isOK = kTRUE;
4245 AliInfo(
"Using custom GRP reconstruction parameters");
4248 AliInfo(
"Loading GRP reconstruction parameter objects");
4253 AliWarning(
"Couldn't find GRP RecoParam entry in OCDB");
4257 TObject *recoParamObj = entry->
GetObject();
4258 if (dynamic_cast<TObjArray*>(recoParamObj)) {
4263 else if (dynamic_cast<AliDetectorRecoParam*>(recoParamObj)) {
4266 AliInfo(
"Single set of GRP reconstruction parameters found");
4271 AliError(
"No valid GRP RecoParam object found in the OCDB");
4279 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
4297 TObject *recoParamObj = entry->
GetObject();
4298 if (dynamic_cast<TObjArray*>(recoParamObj)) {
4303 else if (dynamic_cast<AliDetectorRecoParam*>(recoParamObj)) {
4341 ULong64_t maskNext50 =
fRawReader->GetClassMaskNext50();
4344 UInt_t clmask =
fRawReader->GetDetectorPattern()[0];
4348 TString configstr(
"");
4350 AliError(
"No trigger configuration found in OCDB! The trigger configuration information will not be used!");
4380 AliWarning(
"No trigger can be loaded! The trigger information will not be used!");
4387 AliError(
"No trigger configuration has been found! The trigger configuration information will not be used!");
4391 UChar_t clustmask = 0;
4396 Int_t nclasses = classesArray.GetEntriesFast();
4397 for( Int_t iclass=0; iclass < nclasses; iclass++ ) {
4399 Int_t trindex = trclass->
GetIndex()-1;
4401 Bool_t match = trindex<50 ? (trmask & (1ull << trindex)) : (trmaskNext50 & (1ull << (trindex-50)));
4402 if (!match)
continue;
4404 trclasses += trclass->GetName();
4415 Int_t ninputs = inputsArray.GetEntriesFast();
4416 for( Int_t iinput=0; iinput < ninputs; iinput++ ) {
4418 if (trginput && trginput->
GetMask()>0) {
4419 Int_t inputIndex = (Int_t)TMath::Nint(TMath::Log2(trginput->
GetMask()));
4423 Int_t trglevel = (Int_t)trginput->
GetLevel();
4458 static TString resultList;
4459 TString detList = detectorList;
4464 if ((detectorMask >> iDet) & 0x1) {
4466 if ((detList.CompareTo(
"ALL") == 0) ||
4467 ((detList.BeginsWith(
"ALL ") ||
4468 detList.EndsWith(
" ALL") ||
4469 detList.Contains(
" ALL ")) &&
4470 !(detList.BeginsWith(
"-"+det+
" ") ||
4471 detList.EndsWith(
" -"+det) ||
4472 detList.Contains(
" -"+det+
" "))) ||
4473 (detList.CompareTo(det) == 0) ||
4474 detList.BeginsWith(det+
" ") ||
4475 detList.EndsWith(
" "+det) ||
4476 detList.Contains(
" "+det+
" " )) {
4477 if (!resultList.EndsWith(det +
" ")) {
4488 if ((detList.CompareTo(
"ALL") == 0) ||
4489 ((detList.BeginsWith(
"ALL ") ||
4490 detList.EndsWith(
" ALL") ||
4491 detList.Contains(
" ALL ")) &&
4492 !(detList.BeginsWith(
"-"+hltDet+
" ") ||
4493 detList.EndsWith(
" -"+hltDet) ||
4494 detList.Contains(
" -"+hltDet+
" "))) ||
4495 (detList.CompareTo(hltDet) == 0) ||
4496 detList.BeginsWith(hltDet+
" ") ||
4497 detList.EndsWith(
" "+hltDet) ||
4498 detList.Contains(
" "+hltDet+
" " )) {
4499 resultList += hltDet;
4503 return resultList.Data();
4525 TString whyMess = method;
4526 whyMess +=
" failed! Aborting...";
4531 TString mess =
"Abort";
4532 if (fAbort == kAbortProcess)
4533 mess =
"AbortProcess";
4534 else if (fAbort == kAbortFile)
4537 Info(mess.Data(),
"%s", whyMess.Data());
4563 TPMERegexp re1(
"(\\w+\\.zip#\\w+\\.root):([,*\\w+\\.root,*]+)@dataset://(\\w++)");
4564 TPMERegexp re2(
"(\\w+\\.root)?@?dataset://(\\w++)");
4569 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE",re1[1].Data()));
4570 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",re1[3].Data()));
4571 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_DATASET",
""));
4572 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_ARCHIVE",re1[2].Data()));
4573 AliInfo(Form(
"%s files will be stored within %s in dataset %s",
4581 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE",(re2[1].IsNull()) ?
"AliESDs.root" : re2[1].Data()));
4582 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",re2[2].Data()));
4583 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_DATASET",
""));
4584 AliInfo(Form(
"%s will be stored in dataset %s",
4585 (re2[1].IsNull()) ?
"AliESDs.root" : re2[1].Data(),
4594 TString esdUrl(Form(
"root://%s/%s/",
4595 TUrl(gSystem->HostName()).GetHostFQDN(),
4597 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE",
"AliESDs.root"));
4598 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",esdUrl.Data()));
4599 AliInfo(Form(
"AliESDs.root will be stored in %s",
4606 TString outputFile(gSystem->BaseName(outputUrl.GetFile()));
4607 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE",outputFile.IsNull() ?
"AliESDs.root" : outputFile.Data()));
4608 TString outputLocation(outputUrl.GetUrl());
4609 outputLocation.ReplaceAll(outputFile.Data(),
"");
4610 gProof->AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",outputLocation.Data()));
4611 AliInfo(Form(
"%s will be stored in %s",
4612 outputFile.IsNull() ?
"AliESDs.root" : outputFile.Data(),
4613 outputLocation.Data()));
4627 const Double_t pTmin = 1.5;
4628 const Double_t pTmax = 100;
4634 const Double_t pTminCosmic = 5.;
4635 const Double_t pTmaxCosmic = 100;
4636 ULong_t maskCosmic = 0;
4637 Int_t cosmicCount=0;
4641 Bool_t isOK = kFALSE;
4646 for (Int_t itrk=0; itrk<ntrk; ++itrk) {
4650 && trk->
Pt() > pTmin
4651 && trk->
Pt() < pTmax
4652 && (trk->
GetStatus() & mask) == mask ) {
4661 && (trk->
GetStatus() & maskCosmic) == maskCosmic ) {
4667 if (cosmicCount>1) isOK=kTRUE;
4676 Bool_t isOK = kFALSE;
4694 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
4712 Long64_t nbf =
ftreeF->Fill();
4714 nbf =
ftreeF->GetZipBytes();
4715 if (nbf>0) nbf = -nbf;
4716 else nbf =
ftreeF->GetEntries();
4717 ftreeF->SetAutoFlush(nbf);
4718 AliInfo(Form(
"Calling ftreeF->SetAutoFlush(%lld) | W:%lld T:%lld Z:%lld",
4728 static int iEvent = 0;
4729 if (detectors.IsNull())
return;
4730 TString detStr = detectors;
4731 AliInfo(Form(
"Deleting Digits: %s",detectors.Data()));
4733 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
4745 static int iEvent = 0;
4746 if (detectors.IsNull())
return;
4747 TString detStr = detectors;
4748 AliInfo(Form(
"Deleting Recpoints: %s",detectors.Data()));
4750 for (Int_t iDet = 0; iDet <
kNDetectors; iDet++) {
4766 const int kKB2MB = 1024;
4767 const int kInfMem = 9999999;
4770 int pgSize = getpagesize();
4774 AliInfo(Form(
"Setting max. RSS usage to user value %d MB",
fMaxRSS));
4777 getrlimit(RLIMIT_RSS,&r);
4778 fMaxRSS = r.rlim_max==RLIM_INFINITY ? kInfMem : int(r.rlim_max*pgSize/kKB2MB/kKB2MB) + vRSS;
4779 AliInfo(Form(
"Setting max. RSS usage to system hard limit %d%s MB (%d margin)",
fMaxRSS,r.rlim_max==RLIM_INFINITY ?
"(inf)":
"",-vRSS));
4781 else {
AliInfo(
"No check on RSS memory usage will be applied");}
4785 AliInfo(Form(
"Setting max. VMEM usage to user value %d MB",
fMaxVMEM));
4788 getrlimit(RLIMIT_AS,&r);
4789 fMaxVMEM = r.rlim_max==RLIM_INFINITY ? kInfMem : int(r.rlim_max*pgSize/kKB2MB/kKB2MB) + vVMEM;
4790 AliInfo(Form(
"Setting max. VMEM usage to system hard limit %d%s MB (%d margin)",
fMaxVMEM,r.rlim_max==RLIM_INFINITY ?
"(inf)":
"",-vVMEM));
4792 else {
AliInfo(
"No check on RSS memory usage will be applied");}
4800 const int kKB2MB = 1024;
4805 gSystem->GetProcInfo(&procInfo);
4806 if (procInfo.fMemResident/kKB2MB >
fMaxRSS) res = kFALSE;
4807 if (procInfo.fMemVirtual/kKB2MB >
fMaxVMEM) res = kFALSE;
4810 AliInfo(Form(
"Job exceeded allowed limits: RSS:%d (%d) VMEM:%d (%d), will stop",
4811 int(procInfo.fMemResident/kKB2MB),
fMaxRSS,
4812 int(procInfo.fMemVirtual/kKB2MB) ,
fMaxVMEM));
4816 outfile << ev << std::endl;
4825 return ( (eventId < fRunLoader->GetNumberOfEvents()) ||
4835 AliInfo(Form(
"Check %d entries for matching between sim and rec",nent));
4839 TMap* cdbMapSim = (TMap*)gDirectory->Get(
"cdbMap");
4840 TList* cdbListSim = (TList*)gDirectory->Get(
"cdbList");
4841 if (!(cdbMapSim && cdbListSim)) {
4846 for (Int_t i=0;i<nent;i++) {
4848 if (!cdbent)
continue;
4854 pair = (TPair*)cdbMapSim->FindObject(
"default");
4855 if (!pair) {
AliFatal(
"Did not find default storage used for simulations");
return;}
4856 TString defSimStore = ((TObjString*)pair->Value())->GetString();
4860 TMap cdbMapRecP, *cdbMapRec = &cdbMapRecP;
4861 cdbMapRec->SetName(
"cdbMap");
4862 TList cdbListRecP, *cdbListRec = &cdbListRecP;
4863 cdbListRec->SetName(
"cdbList");
4868 pair = (TPair*)cdbMapRec->FindObject(
"default");
4869 if (!pair) {
AliFatal(
"Did not find default storage used for reconstruction");
return;}
4870 TString defRecStore = ((TObjString*)pair->Value())->GetString();
4873 for (Int_t i=0;i<nent;i++) {
4875 if (!cdbent)
continue;
4877 AliInfo(Form(
"#%d Checking %s",i,cdbent->GetName()));
4880 TString idSim=
"",storSim=
"";
4881 TIter nextSim(cdbListSim);
4882 while ((stro=(TObjString*)nextSim())) {
4883 if (stro->GetString().Contains(cdbent->GetName())) {
4884 idSim = stro->GetString();
4890 pair = (TPair*)cdbMapSim->FindObject(cdbent->GetName());
4892 storSim = ((TObjString*)pair->Value())->GetString();
4895 else storSim = defSimStore;
4897 if (!idSim.IsNull())
AliInfo(Form(
"Sim. used %s from %s",idSim.Data(), storSim.Data()));
4898 else AliInfo(
"Sim. did not use this object");
4901 TString idRec=
"",storRec=
"";
4902 TIter nextRec(cdbListRec);
4903 while ((stro=(TObjString*)nextRec())) {
4904 if (stro->GetString().Contains(cdbent->GetName())) {
4905 idRec = stro->GetString();
4911 pair = (TPair*)cdbMapRec->FindObject(cdbent->GetName());
4913 storRec = ((TObjString*)pair->Value())->GetString();
4916 else storRec = defRecStore;
4918 if (!idRec.IsNull())
AliInfo(Form(
"Rec. used %s from %s",idRec.Data(), storRec.Data()));
4919 else AliInfo(
"Rec. did not use this object");
4921 if (!idSim.IsNull() && !idRec.IsNull() && ((idSim!=idRec) || (storSim!=storRec)) )
4922 AliFatal(
"Different objects were used in sim and rec");
4933 if (!(sbs=url(
"\\?User=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4934 if (!(sbs=url(
"\\?DBFolder=[^?]*")).IsNull()) url.ReplaceAll(
"?DB",
"");
4935 if (!(sbs=url(
"\\?SE=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4936 if (!(sbs=url(
"\\?CacheFolder=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4937 if (!(sbs=url(
"\\?OperateDisconnected=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4938 if (!(sbs=url(
"\\?CacheSize=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4939 if (!(sbs=url(
"\\?CleanupInterval=[^?]*")).IsNull()) url.ReplaceAll(sbs,
"");
4940 Bool_t slash=kFALSE,space=kFALSE;
4941 while ( (slash=url.EndsWith(
"/")) || (space=url.EndsWith(
" ")) ) {
4942 if (slash) url = url.Strip(TString::kTrailing,
'/');
4943 if (space) url = url.Strip(TString::kTrailing,
' ');
4958 TString configstr(
"");
4960 AliError(
"No trigger configuration found in OCDB! The trigger configuration information will not be used!");
4970 AliWarning(
"No trigger can be loaded! The trigger information will not be used!");
4976 AliError(
"No trigger configuration has been found! The trigger configuration information will not be used!");
4983 Int_t nclasses = classesArray.GetEntriesFast();
4989 THashList * lst =
dynamic_cast<THashList*
>(entry->
GetObject());
4991 lst->Sort(kSortDescending);
4996 while((nmd = dynamic_cast<TNamed*>(iter.Next()))) {
5000 if (!classesArray.FindObject(nmd->GetName()))
continue;
5001 TString aliasList(nmd->GetTitle());
5002 TObjArray* arrAliases = aliasList.Tokenize(
',');
5003 Int_t nAliases = arrAliases->GetEntries();
5005 for(Int_t i=0; i<nAliases; i++){
5006 TObjString *alias = (TObjString*) arrAliases->At(i);
5008 TNamed * inlist = (TNamed*)
fAlias2Trigger->FindObject((alias->GetString()).Data());
5010 inlist =
new TNamed((alias->GetString()).Data(),Form(
" %s ",nmd->GetName()));
5014 TString tt(inlist->GetTitle());
5016 tt += Form(
" %s ",nmd->GetName());
5017 inlist->SetTitle(tt.Data());
5023 else AliError(
"Cannot cast the object with trigger aliases to THashList!");
5025 else AliError(
"No OCDB ebtry for the trigger aliases!");
5032 for( Int_t iclass=0; iclass < nclasses; iclass++ ) {
5034 if (!trclass)
continue;
5035 int trindex = trclass->
GetIndex()-1;
5036 fRawReader->LoadTriggerClass(trclass->GetName(),trindex);
5042 Int_t ntokens = tokens->GetEntriesFast();
5043 for (Int_t itoken = 0; itoken < ntokens; ++itoken) {
5044 fRawReader->LoadTriggerClass((((TObjString*)tokens->At(itoken))->String()).Data(),-1);
5050 if (TPRegexp(
"[A-Za-z]").MatchB(
fRawReader->GetParsedTriggerExpression())) {
5051 AliFatalF(
"Unknown triggers found in requested list: %s",
fRawReader->GetParsedTriggerExpression().Data());
5061 TString trName = trigName;
5064 if (!al)
return kFALSE;
5065 TString altrig = al->GetTitle();
5066 return altrig.Contains(Form(
" %s ",trigName));
5078 const Double_t pTminHigh = 1.5, pTmaxHigh = 100;
5080 const ULong_t kPriorityFlag[] =
5091 const int kNPrio =
sizeof(kPriorityFlag)/
sizeof(ULong_t);
5093 float fracHighPt = 0, nHighPtCheck = 0;
5095 Bool_t isSelected = kFALSE;
5101 if (TMath::Abs(bz)<0.5) {
5103 AliInfo(
"AliESDfriends event stored: non-standard field event");
5109 AliInfo(
"AliESDfriends event stored: calibration or cosmic event");
5114 static TArrayS weights;
5115 static TArrayI indices;
5120 if (sparsify && ntrk>weights.GetSize()) {
5121 weights.Set(ntrk+100);
5122 indices.Set(ntrk+100);
5124 Short_t *pWeights = weights.GetArray();
5125 Int_t *pIndices = indices.GetArray();
5127 for (Int_t itrk=0; itrk<ntrk; ++itrk) {
5133 Bool_t isHighPt = kFALSE;
5134 if ( (status&kMaskHighPt) == kMaskHighPt ) {
5135 double pt = trk->
Pt();
5136 isHighPt = (pt>pTminHigh && pt<pTmaxHigh);
5138 if (isHighPt) fracHighPt++;
5143 for (pri=kNPrio;pri--;) {
5144 ULong_t priFlags=kPriorityFlag[pri],priFlagsOK = priFlags&status;
5148 if (priFlagsOK==kPriorityFlag[pri])
break;
5150 pWeights[itrk] = ++pri;
5151 if (isHighPt) pWeights[itrk] += kNPrio;