Skip to content
Snippets Groups Projects
Commit bd6883ca authored by Margherita Spalla's avatar Margherita Spalla
Browse files

Code cleaned up from unnecessary checks and options.

Former-commit-id: b2b6ac33da1e23e99626e1de07db5d70bc2ab0cd
parent 1fec46f4
No related branches found
No related tags found
No related merge requests found
......@@ -33,13 +33,7 @@ class LArOnlineIDStrHelper;
class LArCablingService;
class TProfile2D_LW;
class TProfile_LW;
//class TrigDecisionTool;
class LWHist1D;
class TH1F_LW;
class TH1I_LW;//togliere?
class TH2F_LW;
class TH2I_LW;//togliere?
class LArNoiseCorrelationMon: public ManagedMonitorToolBase
{
......@@ -54,8 +48,7 @@ public:
virtual ~LArNoiseCorrelationMon();
StatusCode initialize();
StatusCode finalize();
StatusCode bookHistograms();
......@@ -66,13 +59,11 @@ protected:
/** services */
LArOnlineIDStrHelper* m_strbisHelper;
LArOnlineIDStrHelper* m_strHelper;
const LArOnlineID* m_LArOnlineIDHelper;
const LArEM_ID* m_LArEM_IDHelper;
/** Handle to LArCablingService */
ToolHandle<LArCablingService> m_LArCablingService; //??
ToolHandle<LArCablingService> m_LArCablingService;
/** Handle to bad-channel mask */
ToolHandle<ILArBadChannelMasker> m_badChannelMask;
......@@ -85,179 +76,43 @@ protected:
private:
/**my test histo*/
int Nchan; //for my test histo
/**correlation histograms*/
int Nchan;
double chan_low,chan_up;
TH2F_LW* m_corr;
TH2F_LW* m_TMP_sums;
TProfile_LW* m_av;
std::string hist_name;
std::string hist_title;
/** The FEB map*/
std::map<HWIdentifier,std::pair<TH2F_LW*,std::pair<TH2F_LW*,TProfile_LW*> > > m_FEBhistograms;
//for handling histograms
std::pair<TH2F_LW*,std::pair<TH2F_LW*,TProfile_LW*> > m_histos;
std::pair<TH2F_LW*,std::pair<TH2F_LW*,TProfile_LW*> > m_histos; //for handling histograms
/** list of FEBs to monitor. FEB names are expected to be of the type LARONLINEID defined in the package atlas/LArCalorimeter/LArMonTools/LArMonTools/LArOnlineIDStrHelper.h e.g. 'BarrelCFT00Slot02' */
std::vector<std::string> m_FEBsToMonitor;
/** to avoid publishing tons of histograms online, in case it's a problem*/
bool m_silenceMonitoringOnline;
/**declaration histo summary*/
// TH2F_LW* m_summary;
//TH2F_LW* m_summaryGain;
/** Define the monitoring histograms used for each partitions of the LArCalorimeter*/
struct partition {
partition():
m_NullDigit(0),
m_SatDigit(0),
m_SatDigitLow(0),
m_OutDigit(0),
m_NullDigitChan(0),
m_SatDigitChan(0),
m_SatDigitChanLow(0),
m_OutDigitChan(0),
m_Temp_NullDigitChan(0),
m_Temp_SatDigitChan(0),
m_Temp_SatDigitChanLow(0),
m_Temp_OutDigitChan(0),
m_PNullDigit(0),
m_PSatDigit(0),
m_PSatDigitLow(0),
m_POutDigit(0),
m_AverDig(0),
m_AverTempPos_PerStream(0),
m_EnTime(0),
m_SignShape(0),
m_MaxVsTime(0),
m_TriggerType(0),
sumpos(0)
{
};
TH2I_LW* m_NullDigit;
TH2I_LW* m_SatDigit;
TH2I_LW* m_SatDigitLow;
TH2I_LW* m_OutDigit;
//define histograms at channel levels
TH2F_LW* m_NullDigitChan;
TH2F_LW* m_SatDigitChan;
TH2F_LW* m_SatDigitChanLow;
TH2F_LW* m_OutDigitChan;
//Declare temporary histograms to be used online...
TH2I_LW* m_Temp_NullDigitChan;
TH2I_LW* m_Temp_SatDigitChan;
TH2I_LW* m_Temp_SatDigitChanLow;
TH2I_LW* m_Temp_OutDigitChan;
TProfile2D_LW* m_PNullDigit;
TProfile2D_LW* m_PSatDigit;
TProfile2D_LW* m_PSatDigitLow;
TProfile2D_LW* m_POutDigit;
TProfile2D_LW* m_AverDig;
TH2I_LW* m_AverTempPos_PerStream;
TH2F_LW* m_EnTime;
TProfile_LW* m_SignShape;
TProfile_LW* m_MaxVsTime;
TProfile_LW* m_TriggerType;
std::string name;
int sumpos;
};
/** Now define the 8 partitions of the LArCalorimeter*/
/*partition m_BarrelA;
partition m_BarrelC;
partition m_EmecA;
partition m_EmecC;
partition m_HecA;
partition m_HecC;
partition m_FcalA;
partition m_FcalC;
*/
/**declare identifier*/
HWIdentifier m_feedthroughID;
int m_slot;
int m_feedthrough;
int m_febHash;
int m_channel;
HWIdentifier m_febID;
int m_ch1,m_ch2;
/**declaration variables used in joboptions*/
int m_SampleRangeLow;
int m_SampleRangeUp;
int m_ADCsatureCut;
int m_SigmaCut;
int m_ExpectedSampleMax;
int m_SampleNumberFromDB;
int m_NumberBadFebs;
bool m_ignoreKnownBadChannels;
bool m_ComputeHistError;
bool m_PercComputed;
bool m_IsOnline;
double m_TreshOut;
double m_TreshNull;
double m_TreshSat;
bool m_ignoreKnownBadChannels;
std::string m_LArDigitContainerKey;
std::string m_larPedestalKey;
//Added for Stream aware:
std::vector<std::string> m_streams;
std::vector<unsigned> m_streamsThisEvent;
/** Private members*/
int m_Samplenbr;
int m_eventsCounter;
int m_evtId;
/** Declare methods used*/
bool isGoodChannel(HWIdentifier id,float ped);
void fillInCorrelation();
void bookSelectedFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC);
void bookAllFEBs(MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC);
void bookThisFEB(HWIdentifier id,MonGroup& grEMBA,MonGroup& grEMBC,MonGroup& grEMECA,MonGroup& grEMECC,MonGroup& grHECA,MonGroup& grHECC,MonGroup& grFCALA,MonGroup& grFCALC);
void BookPartitions(partition& sub, const std::string& hTitle,MonGroup& ShiftGroup,MonGroup& ExpertGroup, MonGroup& ExpertGroupEff);
void HistTitle(LWHist2D* hist,partition& sub);
void HistTitle(TProfile2D_LW* hist,partition& sub);
void HistTitleSum(LWHist2D* hist);
void FillSaturation(partition& sub);
void FillSaturationLow(partition& sub);
void FillOutOfRange(partition& sub);
void FillAverMaxDig(partition& sub, int& i, float nrj, unsigned int& m_l1Trig,unsigned int& lumiblock);
void FillSumary(partition& sub);
void OutHistTitle(partition& sub);
void FillSignShape(partition& sub, int& i,float nrj,float sample_max);
void FillNullHisto(partition& sub);
void ScalePartition(partition& sub);
void EndOfRun(partition& sub);
void myEndOfRun();
void DeleteHist(partition& sub);
void ScaleHisto(LWHist2D * h,int& events);
void ComputeError(LWHist2D* hist,int& events);
// partition& WhatPartition(HWIdentifier id);
int GetNumberCells(TProfile2D_LW* hist1,double treshold);
double GetMeanVal(LWHist2D* hist1);
void ScaleOnlinePartition(partition& sub);
void DumpHisto(LWHist2D* hist1,TProfile2D_LW* hist2);
void DumpOnlineHisto(LWHist2D* hist1,LWHist2D* hist2);
/** control string name types for histo names and titles*/
// LArOnlineIDStrHelper::NameType m_histoNameType; // dws << never used
// LArOnlineIDStrHelper::NameType m_histoTitleType; // dws << never used
};
#endif
......@@ -52,24 +52,6 @@ if 'LArDigitKey' in dir() :
LArMonFlags.LArDigitKey=LArDigitKey
#add some trigger configuration to avoid errors from NoiseCorrelationTool (mspalla)
####################
from TriggerJobOpts.TriggerFlags import TriggerFlags as tf
tf.readBS.set_Value_and_Lock(True)
tf.doLVL1.set_Value_and_Lock(False)
tf.doLVL2.set_Value_and_Lock(False)
tf.doEF.set_Value_and_Lock(False)
tf.doL1Topo.set_Value_and_Lock(False)
tf.readLVL1Calo.set_Value_and_Lock(True)
tf.enableMonitoring.set_Value_and_Lock(False)
tf.doID.set_Value_and_Lock(False)
tf.doMuon.set_Value_and_Lock(False)
tf.doBcm.set_Value_and_Lock(False)
tf.doTrt.set_Value_and_Lock(False)
tf.configForStartup="HLTonline"
tf.configForStartup.lock()
include("TrigTier0/BStoESD_Tier0_HLTConfig_jobOptions.py")
# This is the main block choosing what monitoring to run.
# There is some repetition, but I think maintenance is easier (Rob).
......@@ -95,6 +77,7 @@ if jobproperties.Beam.beamType() == 'cosmics':
if LArMonFlags.doLArDigitMon():
include ("LArMonTools/LArDigitMon_jobOptions.py")
if LArMonFlags.doLArNoiseCorrelationMon():
febs_for_coherent_noise_mon=["barrelaft09slot02","endcapCFT17slot04","EndCapAFT06Slot09"]
include ("LArMonTools/LArNoiseCorrelationMon_jobOptions.py")
if LArMonFlags.doLArNoisyROMon():
include ("LArMonTools/LArNoisyROMon_jobOptions.py")
......
from LArCellRec.LArNoisyROFlags import larNoisyROFlags
#from LArCellRec.LArNoisyROFlags import larNoisyROFlags
# --- for athena online running ---
if 'EventBlockSize' not in dir():
EventBlockSize=0
#Run is Online or Offline:
OnlineMode=athenaCommonFlags.isOnline()
#retrieve the condition for the run in cool offline, in IS online
if OnlineMode:
peakSample_expected = FirstSample
LArSampleNumber = NSamples
else:
from LArConditionsCommon.LArCool import larcool
if (larcool is not None):
peakSample_expected = larcool.firstSample()
LArSampleNumber = larcool.nSamples()
else:
peakSample_expected = 0
LArSampleNumber = 0
#Run is Cosmic or Beam:
CosmicMode=( jobproperties.Beam.beamType()== 'cosmics')
#check if there are FEBs to monitor
if 'febs_for_coherent_noise_mon' not in dir():
febs_for_coherent_noise_mon=[]
#Declare stream if Cosmic or Beam:
if CosmicMode:
StreamsToMonitor = ["CosmicCalo","Standby","LArCellsEmpty","Background"]
else:
StreamsToMonitor = ["CosmicCalo","ZeroBias","Standby","express","Main","L1Calo","L1Topo","LArCells","LArCellsEmpty","Background","LArCellsEmpty"]
###### LArNoiseCorrelationMon Configuration ###############
from LArMonTools.LArMonToolsConf import LArNoiseCorrelationMon
theLArNoiseCorrelationMon = LArNoiseCorrelationMon(name="LArNoiseCorrelationMon",
# OutputLevel=VERBOSE,
LArDigitContainerKey = LArMonFlags.LArDigitKey(),
IsOnline = OnlineMode,
# SampleRangeLow = 5, # If no value set, range defined
# SampleRangeUp = 7, # dynamically in the code
# ExpectedSampleMax = peakSample_expected,
# SampleNumberFromDB = LArSampleNumber,
# ComputeHistError = False,
IgnoreBadChannels = True,
LArBadChannelMask = theLArBadChannelsMasker,
ProcessNEvents = EventBlockSize,
TriggerChain = "HLT_noalg_zb_L1ZB",
# TrigDecisionTool = "Trig::TrigDecisionTool/TrigDecisionTool"
# NumberBadFebs = larNoisyROFlags.BadFEBCut(),
# Streams = StreamsToMonitor
FEBsToMonitor = ["barrelaft09slot02","endcapCFT17slot04","EndCapAFT06Slot09"]
FEBsToMonitor = febs_for_coherent_noise_mon
)
from AthenaCommon.BeamFlags import jobproperties
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment