X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MONITOR%2FAliMonitorProcess.cxx;h=9cfe950da8ce7e0b3d52d58c26d07be5bc58b4a5;hb=fd1d0cb9f78e1bd1ff8597a3eba41ee2a842ba6b;hp=4034f78e2e43198f4de74558da336cfe6639a884;hpb=b6a3610d3fd594b7304e20c19bd76dd5331326a6;p=u%2Fmrichter%2FAliRoot.git diff --git a/MONITOR/AliMonitorProcess.cxx b/MONITOR/AliMonitorProcess.cxx index 4034f78e2e4..9cfe950da8c 100644 --- a/MONITOR/AliMonitorProcess.cxx +++ b/MONITOR/AliMonitorProcess.cxx @@ -33,14 +33,19 @@ #include #include -#include "AliESD.h" -#include "AliITS.h" -#include "AliITSLoader.h" +#include "AliLog.h" +#include "AliESDEvent.h" #include "AliITSclustererV2.h" +#include "AliITSgeom.h" #include "AliITStrackerV2.h" #include "AliLoader.h" +// Matthias 2007-10-03 HLT legacy code disabled +// everything encapsulated by ENABLE_ALIMONITORPROCESS_HLT +// set the define in the header file to include the code +#ifdef ENABLE_ALIMONITORPROCESS_HLT #include "AliMonitorHLT.h" #include "AliMonitorHLTHough.h" +#endif // ENABLE_ALIMONITORPROCESS_HLT #include "AliMonitorITS.h" #include "AliMonitorProcess.h" #include "AliMonitorTPC.h" @@ -52,22 +57,22 @@ #include "AliTPCtrackerMI.h" #include "AliV0vertexer.h" -#ifdef ALI_HLT -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef ENABLE_ALIMONITORPROCESS_HLT +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#endif +#endif // ENABLE_ALIMONITORPROCESS_HLT -ClassImp(AliMonitorProcess) +ClassImp(AliMonitorProcess) const Int_t AliMonitorProcess::fgkPort = 9327; @@ -81,10 +86,43 @@ AliMonitorProcess::AliMonitorProcess( const char* alienHost, #endif const char* alienDir, - const char* fileNameGalice) + const char* selection, + const char* fileNameGalice): + fSelection(selection), + fGrid(NULL), + fAlienDir(alienDir), + fRunLoader(NULL), + fTPCParam(NULL), + fITSgeom(NULL), + fLogicalFileName(""), + fFileName(""), + fHLT(NULL), + fHLTHough(NULL), + + fRunNumber(0), + fSubRunNumber(0), + fNEvents(0), + fNEventsMin(1), + fWriteHistoList(kFALSE), + + fTopFolder(NULL), + fMonitors(), + fFile(NULL), + fTree(NULL), + + fServerSocket(NULL), + fSockets(), + fDisplaySocket(NULL), + + fStatus(kStopped), + fStopping(kFALSE), + + fInterruptHandler(NULL) { // initialize the monitoring process and the monitor histograms + fSelection = selection; + #if ROOT_VERSION_CODE <= 199169 // 3.10/01 fGrid = TGrid::Connect("alien", gSystem->Getenv("USER")); #else @@ -92,58 +130,44 @@ AliMonitorProcess::AliMonitorProcess( #endif if (!fGrid || fGrid->IsZombie() || !fGrid->IsConnected()) { delete fGrid; - Fatal("AliMonitorProcess", "could not connect to alien"); + AliFatal("could not connect to alien"); } #if ROOT_VERSION_CODE <= 199169 // 3.10/01 fGrid->cd(alienDir); -#else - fAlienDir = alienDir; #endif - fLogicalFileName = ""; - fFileName = ""; fRunLoader = AliRunLoader::Open(fileNameGalice); - if (!fRunLoader) Fatal("AliMonitorProcess", - "could not get run loader from file %s", - fileNameGalice); + if (!fRunLoader) AliFatal(Form("could not get run loader from file %s", + fileNameGalice)); fRunLoader->CdGAFile(); fTPCParam = AliTPC::LoadTPCParam(gFile); - if (!fTPCParam) Fatal("AliMonitorProcess", "could not load TPC parameters"); + if (!fTPCParam) AliFatal("could not load TPC parameters"); fRunLoader->LoadgAlice(); gAlice = fRunLoader->GetAliRun(); - if (!gAlice) Fatal("AliMonitorProcess", "no gAlice object found"); - AliITS* its = (AliITS*) gAlice->GetModule("ITS"); - if (!its) Fatal("AliMonitorProcess", "no ITS detector found"); - fITSgeom = its->GetITSgeom(); - if (!fITSgeom) Fatal("AliMonitorProcess", "could not load ITS geometry"); - -#ifdef ALI_HLT -// Init TPC parameters for HLT - Bool_t isinit=AliL3Transform::Init(const_cast(fileNameGalice),kTRUE); + if (!gAlice) AliFatal("no gAlice object found"); + fITSgeom = (AliITSgeom*)gDirectory->Get("AliITSgeom"); + if (!fITSgeom) AliFatal("could not load ITS geometry"); + +#ifdef ENABLE_ALIMONITORPROCESS_HLT + // Init TPC parameters for HLT + Bool_t isinit=AliHLTTransform::Init(const_cast(fileNameGalice),kTRUE); if(!isinit){ - cerr << "Could not create transform settings, please check log for error messages!" << endl; - return; + AliFatal("Could not create transform settings, please check log for error messages!"); } -#endif - - fRunNumber = 0; - fSubRunNumber = 0; - fNEvents = 0; - fNEventsMin = 1; - fWriteHistoList = kFALSE; +#endif // ENABLE_ALIMONITORPROCESS_HLT fTopFolder = new TFolder("Monitor", "monitor histograms"); fTopFolder->SetOwner(kTRUE); - fMonitors.Add(new AliMonitorTPC(fTPCParam)); - fMonitors.Add(new AliMonitorITS(fITSgeom)); - fMonitors.Add(new AliMonitorV0s); -#ifdef ALI_HLT - fMonitors.Add(new AliMonitorHLT(fTPCParam)); - fMonitors.Add(new AliMonitorHLTHough(fTPCParam)); -#endif + if (IsSelected("TPC")) fMonitors.Add(new AliMonitorTPC(fTPCParam)); + if (IsSelected("ITS")) fMonitors.Add(new AliMonitorITS(fITSgeom)); + if (IsSelected("V0s")) fMonitors.Add(new AliMonitorV0s); +#ifdef ENABLE_ALIMONITORPROCESS_HLT + if (IsSelected("HLTConfMap")) fMonitors.Add(new AliMonitorHLT(fTPCParam)); + if (IsSelected("HLTHough")) fMonitors.Add(new AliMonitorHLTHough(fTPCParam)); +#endif // ENABLE_ALIMONITORPROCESS_HLT for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) { ((AliMonitor*) fMonitors[iMonitor])->CreateHistos(fTopFolder); @@ -155,7 +179,7 @@ AliMonitorProcess::AliMonitorProcess( fFile = TFile::Open("monitor_tree.root", "RECREATE"); if (!fFile || !fFile->IsOpen()) { - Fatal("AliMonitorProcess", "could not open file for tree"); + AliFatal("could not open file for tree"); } fTree = new TTree("MonitorTree", "tree for monitoring"); for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) { @@ -165,14 +189,7 @@ AliMonitorProcess::AliMonitorProcess( fServerSocket = new TServerSocket(fgkPort, kTRUE); fServerSocket->SetOption(kNoBlock, 1); - fDisplaySocket = NULL; CheckForConnections(); -#ifdef ALI_HLT - fHLT = NULL; -#endif - - SetStatus(kStopped); - fStopping = kFALSE; fInterruptHandler = new AliMonitorInterruptHandler(this); gSystem->AddSignalHandler(fInterruptHandler); @@ -180,16 +197,48 @@ AliMonitorProcess::AliMonitorProcess( //_____________________________________________________________________________ AliMonitorProcess::AliMonitorProcess(const AliMonitorProcess& process) : - TObject(process) + TObject(process), + + fSelection(""), + fGrid(NULL), + fAlienDir(""), + fRunLoader(NULL), + fTPCParam(NULL), + fITSgeom(NULL), + fLogicalFileName(""), + fFileName(""), + fHLT(NULL), + fHLTHough(NULL), + + fRunNumber(0), + fSubRunNumber(0), + fNEvents(0), + fNEventsMin(1), + fWriteHistoList(kFALSE), + + fTopFolder(NULL), + fMonitors(), + fFile(NULL), + fTree(NULL), + + fServerSocket(NULL), + fSockets(), + fDisplaySocket(NULL), + + fStatus(kStopped), + fStopping(kFALSE), + + fInterruptHandler(NULL) + { - Fatal("AliMonitorProcess", "copy constructor not implemented"); + AliFatal("copy constructor not implemented"); } //_____________________________________________________________________________ -AliMonitorProcess& AliMonitorProcess::operator = (const AliMonitorProcess& +AliMonitorProcess& AliMonitorProcess::operator = (const AliMonitorProcess& /*process*/) { - Fatal("operator =", "assignment operator not implemented"); + AliFatal("assignment operator not implemented"); return *this; } @@ -215,10 +264,10 @@ AliMonitorProcess::~AliMonitorProcess() delete fFile; gSystem->Unlink("monitor_tree.root"); -#ifdef ALI_HLT +#ifdef ENABLE_ALIMONITORPROCESS_HLT delete fHLT; delete fHLTHough; -#endif +#endif // ENABLE_ALIMONITORPROCESS_HLT gSystem->RemoveSignalHandler(fInterruptHandler); delete fInterruptHandler; @@ -245,7 +294,7 @@ void AliMonitorProcess::SetStatus(EStatus status) //_____________________________________________________________________________ void AliMonitorProcess::Run() { -// run the monitor process: +// run the monitor process: // check for a raw data file, process the raw data file and delete it fStopping = kFALSE; @@ -286,8 +335,8 @@ void AliMonitorProcess::ProcessFile(const char* fileName) // create a file with monitor histograms for a single file if (GetStatus() != kStopped) { - Error("ProcessFile", "ProcessFile can not be called" - " while the monitor process is running"); + AliError("ProcessFile can not be called" + " while the monitor process is running"); return; } @@ -306,6 +355,7 @@ Bool_t AliMonitorProcess::CheckForNewFile() { // check whether a new file was registered in alien +#if ROOT_VERSION_CODE < ROOT_VERSION(5,0,0) #if ROOT_VERSION_CODE <= 199169 // 3.10/01 TGridResult* result = fGrid->Ls(); #else @@ -316,8 +366,8 @@ Bool_t AliMonitorProcess::CheckForNewFile() sprintf(findName, "*.root"); Grid_ResultHandle_t handle = fGrid->Find(dirName, findName); if (!handle) { - Error("CheckForNewFile", "could not open alien directory %s", - dirName); + AliError(Form("could not open alien directory %s", + dirName)); return kFALSE; } TGridResult* result = fGrid->CreateGridResult(handle); @@ -363,23 +413,25 @@ Bool_t AliMonitorProcess::CheckForNewFile() fileName = dirName + ("/" + fLogicalFileName); handle = fGrid->GetPhysicalFileNames(fileName.Data()); if (!handle) { - Error("CheckForNewFile", "could not get physical file names for %s", - fileName.Data()); + AliError(Form("could not get physical file names for %s", + fileName.Data())); return kFALSE; } result = fGrid->CreateGridResult(handle); result->Reset(); Grid_Result_t* resultEntry = result->Next(); if (!resultEntry) { - Error("CheckForNewFile", "could not get physical file names for %s", - fileName.Data()); + AliError(Form("could not get physical file names for %s", + fileName.Data())); return kFALSE; } fFileName = resultEntry->name2.c_str(); fFileName.ReplaceAll("castor:/", "rfio:/"); #endif delete result; - +#else + Error("CheckForNewFile", "needs to be ported to new TGrid"); +#endif return kTRUE; } @@ -391,12 +443,12 @@ Bool_t AliMonitorProcess::ProcessFile() Int_t nEvents = GetNumberOfEvents(fFileName); if (nEvents <= 0) return kFALSE; - Info("ProcessFile", "found %d event(s) in file %s", - nEvents, fFileName.Data()); -#ifdef ALI_HLT - CreateHLT(fFileName); - CreateHLTHough(fFileName); -#endif + AliDebug(1, Form("found %d event(s) in file %s", + nEvents, fFileName.Data())); +#ifdef ENABLE_ALIMONITORPROCESS_HLT + if (IsSelected("HLTConfMap")) CreateHLT(fFileName); + if (IsSelected("HLTHough")) CreateHLTHough(fFileName); +#endif // ENABLE_ALIMONITORPROCESS_HLT // loop over the events for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { @@ -418,39 +470,51 @@ Bool_t AliMonitorProcess::ProcessFile() // monitor only central physics events if (rawReader.GetType() != 7) continue; if ((rawReader.GetAttributes()[0] & 0x02) == 0) continue; - Info("ProcessFile", "run: %d event: %d %d\n", rawReader.GetRunNumber(), - rawReader.GetEventId()[0], rawReader.GetEventId()[1]); + AliInfo(Form("run: %d event: %d %d\n", rawReader.GetRunNumber(), + rawReader.GetEventId()[0], rawReader.GetEventId()[1])); - AliESD esd; - CheckForConnections(); - if (!ReconstructTPC(&rawReader, &esd)) return kFALSE; - if (fStopping) break; - CheckForConnections(); - if (!ReconstructITS(&rawReader, &esd)) return kFALSE; - if (fStopping) break; - CheckForConnections(); - if (!ReconstructV0s(&esd)) return kFALSE; - if (fStopping) break; - CheckForConnections(); - if (!ReconstructHLT(iEvent)) return kFALSE; - if (fStopping) break; - CheckForConnections(); - if (!ReconstructHLTHough(iEvent)) return kFALSE; - if (fStopping) break; + AliESDEvent esd; + if (IsSelected("TPC")) { + CheckForConnections(); + if (!ReconstructTPC(&rawReader, &esd)) return kFALSE; + if (fStopping) break; + } + if (IsSelected("ITS")) { + CheckForConnections(); + if (!ReconstructITS(&rawReader, &esd)) return kFALSE; + if (fStopping) break; + } + if (IsSelected("V0s")) { + CheckForConnections(); + if (!ReconstructV0s(&esd)) return kFALSE; + if (fStopping) break; + } +#ifdef ENABLE_ALIMONITORPROCESS_HLT + if (IsSelected("HLTConfMap")) { + CheckForConnections(); + if (!ReconstructHLT(iEvent)) return kFALSE; + if (fStopping) break; + } + if (IsSelected("HLTHough")) { + CheckForConnections(); + if (!ReconstructHLTHough(iEvent)) return kFALSE; + if (fStopping) break; + } +#endif // ENABLE_ALIMONITORPROCESS_HLT if (fDisplaySocket) fDisplaySocket->Send("new event"); - Info("ProcessFile", "filling histograms..."); + AliDebug(1, "filling histograms..."); for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) { CheckForConnections(); SetStatus(kFilling); - ((AliMonitor*) fMonitors[iMonitor])->FillHistos(fRunLoader, &rawReader, + ((AliMonitor*) fMonitors[iMonitor])->FillHistos(fRunLoader, &rawReader, &esd); if (fStopping) break; } if (fStopping) break; - Info("ProcessFile", "updating histograms..."); + AliDebug(1, "updating histograms..."); CheckForConnections(); SetStatus(kUpdating); TIterator* iFolder = fTopFolder->GetListOfFolders()->MakeIterator(); @@ -464,10 +528,10 @@ Bool_t AliMonitorProcess::ProcessFile() delete iFolder; if (fStopping) break; - Info("ProcessFile", "filling the tree..."); + AliDebug(1, "filling the tree..."); fTree->Fill(); - Info("ProcessFile", "broadcasting histograms..."); + AliDebug(1, "broadcasting histograms..."); CheckForConnections(); BroadcastHistos(); @@ -475,10 +539,16 @@ Bool_t AliMonitorProcess::ProcessFile() if (fStopping) break; } -#ifdef ALI_HLT - delete fHLT; - fHLT = NULL; -#endif +#ifdef ENABLE_ALIMONITORPROCESS_HLT + if (fHLT) { + delete fHLT; + fHLT = NULL; + } + if (fHLTHough) { + delete fHLTHough; + fHLTHough = NULL; + } +#endif // ENABLE_ALIMONITORPROCESS_HLT return kTRUE; } @@ -528,14 +598,14 @@ Int_t AliMonitorProcess::GetNumberOfEvents(const char* fileName) const TFile* file = TFile::Open(fileName); if (!file || !file->IsOpen()) { - Error("GetNumberOfEvents", "could not open file %s", fileName); + AliError(Form("could not open file %s", fileName)); if (file) delete file; return -1; } TTree* tree = (TTree*) file->Get("RAW"); if (!tree) { - Error("GetNumberOfEvents", "could not find tree with raw data"); + AliError("could not find tree with raw data"); } else { nEvents = (Int_t) tree->GetEntries(); } @@ -546,7 +616,7 @@ Int_t AliMonitorProcess::GetNumberOfEvents(const char* fileName) const } //_____________________________________________________________________________ -Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESD* esd) +Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESDEvent* esd) { // find TPC clusters and tracks @@ -554,13 +624,13 @@ Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESD* esd) AliLoader* tpcLoader = fRunLoader->GetLoader("TPCLoader"); if (!tpcLoader) { - Error("ReconstructTPC", "no TPC loader found"); + AliError("no TPC loader found"); return kFALSE; } gSystem->Unlink("TPC.RecPoints.root"); // cluster finder - Info("ReconstructTPC", "reconstructing clusters..."); + AliDebug(1, "reconstructing clusters..."); tpcLoader->LoadRecPoints("recreate"); AliTPCclustererMI clusterer(fTPCParam); tpcLoader->MakeRecPointsContainer(); @@ -569,7 +639,7 @@ Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESD* esd) tpcLoader->WriteRecPoints("OVERWRITE"); // track finder - Info("ReconstructTPC", "reconstructing tracks..."); + AliDebug(1, "reconstructing tracks..."); AliTPCtrackerMI tracker(fTPCParam); tracker.LoadClusters(tpcLoader->TreeR()); tracker.Clusters2Tracks(esd); @@ -580,7 +650,7 @@ Bool_t AliMonitorProcess::ReconstructTPC(AliRawReader* rawReader, AliESD* esd) } //_____________________________________________________________________________ -Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader, AliESD* esd) +Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader, AliESDEvent* esd) { // find ITS clusters and tracks @@ -588,21 +658,21 @@ Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader, AliESD* esd) AliLoader* itsLoader = fRunLoader->GetLoader("ITSLoader"); if (!itsLoader) { - Error("ReconstructITS", "no ITS loader found"); + AliError("no ITS loader found"); return kFALSE; } gSystem->Unlink("ITS.RecPoints.root"); // cluster finder - Info("ReconstructITS", "reconstructing clusters..."); + AliDebug(1, "reconstructing clusters..."); itsLoader->LoadRecPoints("recreate"); - AliITSclustererV2 clusterer(fITSgeom); + AliITSclustererV2 clusterer(0); itsLoader->MakeRecPointsContainer(); clusterer.Digits2Clusters(rawReader); // track finder - Info("ReconstructITS", "reconstructing tracks..."); - AliITStrackerV2 tracker(fITSgeom); + AliDebug(1, "reconstructing tracks..."); + AliITStrackerV2 tracker(0); tracker.LoadClusters(itsLoader->TreeR()); tracker.Clusters2Tracks(esd); tracker.UnloadClusters(); @@ -612,25 +682,22 @@ Bool_t AliMonitorProcess::ReconstructITS(AliRawReader* rawReader, AliESD* esd) } //_____________________________________________________________________________ -Bool_t AliMonitorProcess::ReconstructV0s(AliESD* esd) +Bool_t AliMonitorProcess::ReconstructV0s(AliESDEvent* esd) { // find V0s SetStatus(kRecV0s); // V0 finder - Info("ReconstructV0s", "reconstructing V0s..."); + AliDebug(1, "reconstructing V0s..."); AliV0vertexer vertexer; - Double_t vtx[3]; - esd->GetVertex()->GetXYZ(vtx); - vertexer.SetVertex(vtx); vertexer.Tracks2V0vertices(esd); return kTRUE; } +#ifdef ENABLE_ALIMONITORPROCESS_HLT //_____________________________________________________________________________ -#ifdef ALI_HLT void AliMonitorProcess::CreateHLT(const char* fileName) { @@ -644,7 +711,7 @@ void AliMonitorProcess::CreateHLT(const char* fileName) fHLT->Init("./", AliLevel3::kRaw, 1); fHLT->SetClusterFinderParam(-1, -1, kTRUE); - + Int_t phiSegments = 50; Int_t etaSegments = 100; Int_t trackletlength = 3; @@ -659,15 +726,17 @@ void AliMonitorProcess::CreateHLT(const char* fileName) Double_t hitChi2Cut = 15;//100 or 15 Double_t goodHitChi2 = 5;//20 or 5 Double_t trackChi2Cut = 10;//50 or 10 - fHLT->SetTrackerParam(phiSegments, etaSegments, + fHLT->SetTrackerParam(phiSegments, etaSegments, trackletlength, tracklength, rowscopetracklet, rowscopetrack, minPtFit, maxangle, goodDist, hitChi2Cut, goodHitChi2, trackChi2Cut, 50, maxphi, maxeta, kTRUE); - - fHLT->WriteFiles("./hlt/"); + + fHLT->WriteFiles("./hlt/"); } +#endif // ENABLE_ALIMONITORPROCESS_HLT +#ifdef ENABLE_ALIMONITORPROCESS_HLT //_____________________________________________________________________________ void AliMonitorProcess::CreateHLTHough(const char* fileName) { @@ -679,7 +748,7 @@ void AliMonitorProcess::CreateHLTHough(const char* fileName) char name[256]; strcpy(name, fileName); - fHLTHough = new AliL3Hough(); + fHLTHough = new AliHLTHough(); fHLTHough->SetThreshold(4); fHLTHough->SetTransformerParams(140,150,0.5,-1); fHLTHough->SetPeakThreshold(9000,-1);// or 6000 @@ -688,26 +757,16 @@ void AliMonitorProcess::CreateHLTHough(const char* fileName) // fHLTHough->GetMaxFinder()->SetThreshold(14000); } -#endif +#endif // ENABLE_ALIMONITORPROCESS_HLT +#ifdef ENABLE_ALIMONITORPROCESS_HLT //_____________________________________________________________________________ -Bool_t AliMonitorProcess::ReconstructHLT( -#ifdef ALI_HLT - Int_t iEvent -#else - Int_t /* iEvent */ -#endif -) +Bool_t AliMonitorProcess::ReconstructHLT(Int_t iEvent) { // run the HLT cluster and track finder SetStatus(kRecHLT); -#ifndef ALI_HLT - Warning("ReconstructHLT", "the code was compiled without HLT support"); - return kTRUE; - -#else gSystem->Exec("rm -rf hlt"); gSystem->MakeDirectory("hlt"); if (!fHLT) return kFALSE; @@ -725,27 +784,17 @@ Bool_t AliMonitorProcess::ReconstructHLT( sprintf(command, "rename tracks_%d tracks hlt/*.raw", iEvent); gSystem->Exec(command); return kTRUE; -#endif } +#endif // ENABLE_ALIMONITORPROCESS_HLT +#ifdef ENABLE_ALIMONITORPROCESS_HLT //_____________________________________________________________________________ -Bool_t AliMonitorProcess::ReconstructHLTHough( -#ifdef ALI_HLT - Int_t iEvent -#else - Int_t /* iEvent */ -#endif -) +Bool_t AliMonitorProcess::ReconstructHLTHough(Int_t iEvent) { // run the HLT Hough transformer SetStatus(kRecHLT); -#ifndef ALI_HLT - Warning("ReconstructHLTHough", "the code was compiled without HLT support"); - return kTRUE; - -#else gSystem->Exec("rm -rf hlt/hough"); gSystem->MakeDirectory("hlt/hough"); gSystem->Exec("rm -rf hlt/fitter"); @@ -766,7 +815,7 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( fHLTHough->WriteTracks("./hlt/hough"); // Run cluster fitter - AliL3ClusterFitter *fitter = new AliL3ClusterFitter("./hlt"); + AliHLTClusterFitter *fitter = new AliHLTClusterFitter("./hlt"); // Set debug flag for the cluster fitter // fitter->Debug(); @@ -775,11 +824,11 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( fitter->SetInnerWidthFactor(1,1.5); fitter->SetOuterWidthFactor(1,1.5); fitter->SetNmaxOverlaps(5); - + //fitter->SetChiSqMax(5,kFALSE); //isolated clusters fitter->SetChiSqMax(5,kTRUE); //overlapping clusters - Int_t rowrange[2] = {0,AliL3Transform::GetNRows()-1}; + Int_t rowrange[2] = {0,AliHLTTransform::GetNRows()-1}; // Takes input from global hough tracks produced by HT fitter->LoadSeeds(rowrange,kFALSE,iEvent); @@ -788,12 +837,12 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( for(Int_t islice = 0; islice <= 35; islice++) { - for(Int_t ipatch = 0; ipatch < AliL3Transform::GetNPatches(); ipatch++) + for(Int_t ipatch = 0; ipatch < AliHLTTransform::GetNPatches(); ipatch++) { // Read digits fHLTHough->GetMemHandler(ipatch)->Free(); fHLTHough->GetMemHandler(ipatch)->Init(islice,ipatch); - AliL3DigitRowData *digits = (AliL3DigitRowData *)fHLTHough->GetMemHandler(ipatch)->AliAltroDigits2Memory(ndigits,iEvent); + AliHLTDigitRowData *digits = (AliHLTDigitRowData *)fHLTHough->GetMemHandler(ipatch)->AliAltroDigits2Memory(ndigits,iEvent); fitter->Init(islice,ipatch); fitter->SetInputData(digits); @@ -803,15 +852,15 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( } // Refit of the clusters - AliL3Vertex vertex; + AliHLTVertex vertex; //The seeds are the input tracks from circle HT - AliL3TrackArray *tracks = fitter->GetSeeds(); - AliL3Fitter *ft = new AliL3Fitter(&vertex,1); + AliHLTTrackArray *tracks = fitter->GetSeeds(); + AliHLTFitter *ft = new AliHLTFitter(&vertex,1); ft->LoadClusters("./hlt/fitter/",iEvent,kFALSE); for(Int_t i=0; iGetNTracks(); i++) { - AliL3Track *track = tracks->GetCheckedTrack(i); + AliHLTTrack *track = tracks->GetCheckedTrack(i); if(!track) continue; if(track->GetNHits() < 20) continue; ft->SortTrackClusters(track); @@ -819,7 +868,7 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( track->UpdateToFirstPoint(); } delete ft; - + //Write the final tracks fitter->WriteTracks(20); @@ -834,13 +883,13 @@ Bool_t AliMonitorProcess::ReconstructHLTHough( sprintf(command, "rename points_%d points hlt/fitter/*.raw", iEvent); gSystem->Exec(command); return kTRUE; -#endif } +#endif // ENABLE_ALIMONITORPROCESS_HLT //_____________________________________________________________________________ Bool_t AliMonitorProcess::WriteHistos() { -// write the monitor tree and the monitor histograms to the file +// write the monitor tree and the monitor histograms to the file // "monitor_[_].root" // if at least fNEventsMin events were monitored @@ -865,7 +914,7 @@ Bool_t AliMonitorProcess::WriteHistos() fFile = TFile::Open("monitor_tree.root", "RECREATE"); if (!fFile || !fFile->IsOpen()) { - Fatal("WriteHistos", "could not open file for tree"); + AliFatal("could not open file for tree"); } fTree = new TTree("MonitorTree", "tree for monitoring"); for (Int_t iMonitor = 0; iMonitor < fMonitors.GetEntriesFast(); iMonitor++) { @@ -895,7 +944,7 @@ Bool_t AliMonitorProcess::WriteHistos() } TFile* file = TFile::Open(fileName, "recreate"); if (!file || !file->IsOpen()) { - Error("WriteHistos", "could not open file %s", fileName); + AliError(Form("could not open file %s", fileName)); result = kFALSE; } else { fTopFolder->Write(); @@ -939,9 +988,9 @@ void AliMonitorProcess::CheckForConnections() gSystem->Sleep(1000); if (socket->Recv(socketType, 255) <= 0) { TInetAddress adr = socket->GetInetAddress(); - Error("CheckForConnections", "no socket type received - " - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("no socket type received - " + "disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete socket; continue; } @@ -949,8 +998,8 @@ void AliMonitorProcess::CheckForConnections() if (strcmp(socketType, "client") == 0) { fSockets.Add(socket); TInetAddress adr = socket->GetInetAddress(); - Info("CheckForConnections", "new client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliInfo(Form("new client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); if (fNEvents > 0) BroadcastHistos(socket); } else if (strcmp(socketType, "display") == 0) { if (fDisplaySocket) { @@ -959,13 +1008,13 @@ void AliMonitorProcess::CheckForConnections() } fDisplaySocket = socket; TInetAddress adr = socket->GetInetAddress(); - Info("CheckForConnections", "new display:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliInfo(Form("new display: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); } else { TInetAddress adr = socket->GetInetAddress(); - Error("CheckForConnections", "unknown socket type %s - " - "disconnect client:\n %s (%s), port %d\n", socketType, - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("unknown socket type %s - " + "disconnect client: %s (%s), port %d", socketType, + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete socket; continue; } @@ -979,9 +1028,8 @@ void AliMonitorProcess::CheckForConnections() if (socket->Recv(controlMessage, 255)) { if (strcmp(controlMessage, "disconnect") == 0) { TInetAddress adr = socket->GetInetAddress(); - Info("CheckForConnections", - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliInfo(Form("disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); continue; } @@ -989,9 +1037,8 @@ void AliMonitorProcess::CheckForConnections() if (!socket->IsValid()) { // remove invalid sockets from the list TInetAddress adr = socket->GetInetAddress(); - Error("CheckForConnections", - "disconnect invalid client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("disconnect invalid client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); } } @@ -1005,7 +1052,7 @@ void AliMonitorProcess::BroadcastHistos(TSocket* toSocket) SetStatus(kBroadcasting); TMessage message(kMESS_OBJECT); - message.WriteObject(fTopFolder); + message.WriteObject(fTopFolder); for (Int_t iSocket = 0; iSocket < fSockets.GetEntriesFast(); iSocket++) { TSocket* socket = (TSocket*) fSockets[iSocket]; @@ -1015,9 +1062,9 @@ void AliMonitorProcess::BroadcastHistos(TSocket* toSocket) // send control message if (!socket->IsValid() || (socket->Send("histograms") <= 0)) { TInetAddress adr = socket->GetInetAddress(); - Error("BroadcastHistos", "connection to client failed - " - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("connection to client failed - " + "disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); } @@ -1030,17 +1077,17 @@ void AliMonitorProcess::BroadcastHistos(TSocket* toSocket) } if (result <= 0) { TInetAddress adr = socket->GetInetAddress(); - Error("BroadcastHistos", "no response from client - " - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("no response from client - " + "disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); continue; } if (strcmp(controlMessage, "ok") != 0) { TInetAddress adr = socket->GetInetAddress(); - Error("BroadcastHistos", "no \"ok\" message from client - " - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("no \"ok\" message from client - " + "disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); continue; } @@ -1049,9 +1096,9 @@ void AliMonitorProcess::BroadcastHistos(TSocket* toSocket) if (socket->Send(message) < 0) { // remove the socket from the list if there was an error TInetAddress adr = socket->GetInetAddress(); - Error("BroadcastHistos", "sending histograms failed - " - "disconnect client:\n %s (%s), port %d\n", - adr.GetHostName(), adr.GetHostAddress(), adr.GetPort()); + AliError(Form("sending histograms failed - " + "disconnect client: %s (%s), port %d", + adr.GetHostName(), adr.GetHostAddress(), adr.GetPort())); delete fSockets.RemoveAt(iSocket); } else { gSystem->Sleep(100); @@ -1065,39 +1112,18 @@ void AliMonitorProcess::BroadcastHistos(TSocket* toSocket) //_____________________________________________________________________________ AliMonitorProcess::AliMonitorInterruptHandler::AliMonitorInterruptHandler (AliMonitorProcess* process): - TSignalHandler(kSigUser1, kFALSE), - fProcess(process) + TSignalHandler(kSigUser1, kFALSE), + fProcess(process) { // constructor: set process } //_____________________________________________________________________________ -AliMonitorProcess::AliMonitorInterruptHandler::AliMonitorInterruptHandler - (const AliMonitorInterruptHandler& handler): - TSignalHandler(handler) -{ -// copy constructor - - Fatal("AliMonitorInterruptHandler", "copy constructor not implemented"); -} - -//_____________________________________________________________________________ -AliMonitorProcess::AliMonitorInterruptHandler& - AliMonitorProcess::AliMonitorInterruptHandler::operator = - (const AliMonitorInterruptHandler& /*handler*/) -{ -// assignment operator - - Fatal("operator =", "assignment operator not implemented"); - return *this; -} - -//_____________________________________________________________________________ -Bool_t AliMonitorProcess::AliMonitorInterruptHandler::Notify() +Bool_t AliMonitorProcess::AliMonitorInterruptHandler::Notify() { // interrupt signal -> stop process - Info("Notify", "the monitoring process will be stopped."); - fProcess->Stop(); + AliInfo("the monitoring process will be stopped."); + fProcess->Stop(); return kTRUE; }