Run Type: PHYSICS STANDALONE
DA Type: MON
Number of events needed: all (or at least as much as possible...)
- Input Files: 09000094301009.10.raw
+ Input Files: 10000119041028.20.raw 10000130367042.10.raw 10000120691024.50.raw
Output Files: mch.occupancy, to be exported to the DAQ FXS
Trigger types used: PHYSICS_EVENT
*/
///
/// $Id$
+#include "AliDAQ.h"
#include "AliMUON2DMap.h"
#include "AliMUONCalibParamNI.h"
#include "AliMUONRawStreamTrackerHP.h"
#endif
const char* OUTPUT_FILE = "mch.occupancy";
-const char* DAVERSION = "MUONTRKOCCda v1.4 ($Id$)";
+const char* DAVERSION = "MUONTRKOCCda v1.61 ($Id$)";
//______________________________________________________________________________
void Add(AliMUONVStore& destStore, const AliMUONVStore& srcStore)
//______________________________________________________________________________
void GenerateOutputFile(const AliMUONVStore& store, ostream& out,
- Int_t runNumber, Int_t nevents)
+ Int_t runNumber, Int_t nevents, Int_t numberOfEventsWithMCH)
{
/// Write the channel hit count (grouped by manu) in the output file.
out << "//---------------------------------------------------------------------------" << endl;
out << "// BP MANU SUM_N NEVENTS" << endl;
out << "//---------------------------------------------------------------------------" << endl;
+
+ Int_t nlines(0);
while ( ( manu = static_cast<AliMUONVCalibParam*>(next()) ) )
{
Int_t sum(0);
-// Int_t nevents(0);
for ( Int_t i = 0; i < manu->Size(); ++i )
{
sum += manu->ValueAsInt(i);
- // nevents = TMath::Max(nevents,manu->ValueAsInt(i,1));
- // nevents = TMath::Max(nevents,manu->ValueAsInt(i,1));
}
out << Form("%5d %5d %10d %10d",manu->ID0(),manu->ID1(),sum,nevents) << endl;
+ ++nlines;
+ }
+
+ if (!nlines)
+ {
+ // ok : empty output. Is it because the run was empty ?
+ if ( !numberOfEventsWithMCH )
+ {
+ // yes. Let give a hint in the file so the Shuttle preprocessor will know about this...
+ out << Form("%5d %5d %10d %10d",-1,-1,0,0) << endl;
+ }
+ // else the preprocessor will fail, and that's good because there's something wrong somewhere...
}
}
Int_t numberOfBadEvents(0);
Int_t numberOfUsedEvents(0);
+ Int_t numberOfEventsWithMCH(0);
+
AliMUON2DMap oneEventData(kTRUE);
AliMUON2DMap accumulatedData(kTRUE);
runNumber = rawReader->GetRunNumber();
}
+ // *without* using the MUONTRK event decoder, we update the number
+ // of events where we have information about MUONTRK.
+ // this should be what is called subevents in the logbook
+ // we do *not* use the MCH decoder on purpose, to not mistakenly
+ // believe there's no event if the data is corrupted (and thus the decoder
+ // "sees" nothing).
+
+ Bool_t mchThere(kFALSE);
+
+ for ( int iDDL = 0; iDDL < AliDAQ::NumberOfDdls("MUONTRK") && !mchThere; ++iDDL )
+ {
+ rawReader->Reset();
+ rawReader->Select("MUONTRK",iDDL,iDDL);
+ if (rawReader->ReadHeader() )
+ {
+ if (rawReader->GetEquipmentSize() ) mchThere = kTRUE;
+ }
+ }
+
+ if ( mchThere) ++numberOfEventsWithMCH;
+
+ rawReader->Reset();
+
+ // now do our real work with the MCH decoder
+
AliMUONRawStreamTrackerHP stream(rawReader);
stream.DisableWarnings();
}
- cout << Form("%12d events processed : %12d physics %d used ones %d bad ones",
- numberOfEvents,numberOfPhysicsEvent,numberOfUsedEvents,numberOfBadEvents) << endl;
+ cout << Form("%12d events processed : %12d physics %d used ones %d bad ones [ %d with MCH information ]",
+ numberOfEvents,numberOfPhysicsEvent,numberOfUsedEvents,numberOfBadEvents,numberOfEventsWithMCH) << endl;
ofstream fout(OUTPUT_FILE);
- GenerateOutputFile(accumulatedData,fout,runNumber,numberOfUsedEvents);
+ GenerateOutputFile(accumulatedData,fout,runNumber,numberOfUsedEvents,numberOfEventsWithMCH);
fout.close();
+ /* store the result file on FXS */
+ if (daqDA_FES_storeFile(OUTPUT_FILE,"OCCUPANCY")) return -9;
+
#ifdef ALI_AMORE
if ( numberOfUsedEvents ) // do not update the AMORE pool with an empty object...
ostringstream str;
- GenerateOutputFile(accumulatedData,str,runNumber,numberOfUsedEvents);
+ GenerateOutputFile(accumulatedData,str,runNumber,numberOfUsedEvents,numberOfEventsWithMCH);
TObjString occupancyAsString(str.str().c_str());
+ cout << "will send to amore" << endl;
+
Int_t status = amoreDA.Send("Occupancy",&occupancyAsString);
if ( status )
{
cerr << "ERROR : Failed to write occupancies in the AMORE database : " << status << endl;
}
}
-
-#endif
- /* store the result file on FXS */
- if (daqDA_FES_storeFile(OUTPUT_FILE,"OCCUPANCY")) return -9;
-
+#endif
+
timers.Stop();
printf("\nExecution time : R:%7.2fs C:%7.2fs\n", timers.RealTime(), timers.CpuTime());