AliRoot Core  3dc7879 (3dc7879)
MCHBPEVOda.cxx File Reference
#include "AliDAQ.h"
#include "AliMergeableCollection.h"
#include "AliMpConstants.h"
#include "AliMUONBusPatchEvolution.h"
#include "AliMUONRawStreamTrackerHP.h"
#include "AliRawEventHeaderBase.h"
#include "AliRawReaderDate.h"
#include "daqDA.h"
#include "event.h"
#include "monitor.h"
#include "Riostream.h"
#include "signal.h"
#include "TDatime.h"
#include "TEnv.h"
#include "TFile.h"
#include "TH1.h"
#include "TMath.h"
#include "TObjString.h"
#include "TPluginManager.h"
#include "TROOT.h"
#include "TStopwatch.h"
#include "TString.h"
#include "TTimeStamp.h"
Include dependency graph for MCHBPEVOda.cxx:

Go to the source code of this file.

Functions

Int_t AssertHistogramsRange (AliMergeableCollection &hc, Int_t timeFromRef, const std::vector< int > &timeResolutions, const std::map< int, int > &busPatches)
 
void FillBusPatchesMap (std::map< int, int > &buspatches)
 
void FillCollection (AliMergeableCollection &hc, UInt_t timeOrigin, int maxDuration, int timeResolution, const std::map< int, int > &buspatches)
 
void ReportFaultyBusPatches (AliMergeableCollection &hc, const std::map< int, int > &buspatches, int timeResolution, int requiredEvents, float occupancyThreshold)
 
int main (int argc, char **argv)
 

Variables

const char * OUTPUT_FILE = "mchbpevo.root"
 
const char * DAVERSION = "MCHPBEVOda v0.2 ($Id$)"
 
const char * CONFIG_FILE = "mchbpevo.conf"
 
int DEFAULT_MAX_DURATION = 5*60*60
 
int DEFAULT_TIME_RESOLUTION = 60
 
int DEFAULT_NOF_EVENTS_REQUIRED_FOR_DECISION = 10000
 
float DEFAULT_OCCUPANCY_THRESHOLD = 0.30
 

Function Documentation

Int_t AssertHistogramsRange ( AliMergeableCollection hc,
Int_t  timeFromRef,
const std::vector< int > &  timeResolutions,
const std::map< int, int > &  busPatches 
)

Insure the histograms in hc are big enough to accomodate timeFromRef timeFromRef can be negative or positive Return 1 if a re-allocation has been performed, 0 otherwise

Definition at line 83 of file MCHBPEVOda.cxx.

Referenced by main().

void FillBusPatchesMap ( std::map< int, int > &  buspatches)

Fill the map of buspatches, giving the relation between the bus patch id and the number of pads readout by this bus patch.

In principle (for maximum flexibility) that information should come from the configuration file. But the mapping of the detector is not a thing that is changing often, if ever, so we provide a very sensible default here.

Ain't pretty, but the code below can be cut and paste from the execution of the MakeConfigCodeForBPEVOda function in $ALICE_ROOT/../src/MUON/DA/MCHBPEVOdaUtils.C macro

Definition at line 173 of file MCHBPEVOda.cxx.

Referenced by main().

void FillCollection ( AliMergeableCollection hc,
UInt_t  timeOrigin,
int  maxDuration,
int  timeResolution,
const std::map< int, int > &  buspatches 
)

Create the BusPatch and Event histograms

Definition at line 1077 of file MCHBPEVOda.cxx.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Main method.

We sort the time resolutions so the finer one will be used in AssertHistogramsRange

Definition at line 1168 of file MCHBPEVOda.cxx.

void ReportFaultyBusPatches ( AliMergeableCollection hc,
const std::map< int, int > &  buspatches,
int  timeResolution,
int  requiredEvents,
float  occupancyThreshold 
)

Loop over all bus patches and compute their occupancy in the last nevents

Definition at line 1122 of file MCHBPEVOda.cxx.

Referenced by main().

Variable Documentation

const char* CONFIG_FILE = "mchbpevo.conf"

Definition at line 76 of file MCHBPEVOda.cxx.

Referenced by main().

const char* DAVERSION = "MCHPBEVOda v0.2 ($Id$)"

Definition at line 75 of file MCHBPEVOda.cxx.

Referenced by AssertHistogramsRange(), FillCollection(), main(), and ReportFaultyBusPatches().

int DEFAULT_MAX_DURATION = 5*60*60

Definition at line 77 of file MCHBPEVOda.cxx.

Referenced by main().

int DEFAULT_NOF_EVENTS_REQUIRED_FOR_DECISION = 10000

Definition at line 79 of file MCHBPEVOda.cxx.

Referenced by main().

float DEFAULT_OCCUPANCY_THRESHOLD = 0.30

Definition at line 80 of file MCHBPEVOda.cxx.

Referenced by main().

int DEFAULT_TIME_RESOLUTION = 60

Definition at line 78 of file MCHBPEVOda.cxx.

Referenced by main().

const char* OUTPUT_FILE = "mchbpevo.root"

MUON TRACKER DA to compute the evolution of the bus patches hit count, which can be used to alert in case of high occupancy

In the end, this DA produces a Root file containing histograms with the hit count all the buspatches (that were seen in the data flow) of MCH as a function of time (and the number of events seen, so we can later on compute the occupancy)

The time resolutions used are defined in the detDB configuration file mchbpevo.conf if it exists or otherwise defaults to 60s

Note that, to avoid having to access the mapping (from the OCDB) of MCH, we do rely on some mapping information (list of bus patch ids and their number of pads) to be present in the configuration file for this DA. We also provide defaults in this code in case the configuration is not properly setup.

$Id$

Definition at line 74 of file MCHBPEVOda.cxx.

Referenced by main().