74 ATH_MSG_INFO(
"Initialize LArCoherentNoisefractionMonAlg" );
87 ATH_MSG_ERROR(
"Wrong configuration of LArCoherentNoisefractionMonAlg, bombing !");
88 return StatusCode::FAILURE;
90 unsigned int nGroups=0;
97 return StatusCode::FAILURE;
102 bool plotThisFEB=
false;
109 if(plotThisFEB)
m_febMap.emplace_back(*feb);
119 return StatusCode::SUCCESS;
130 if(
m_FEBlist.size() == 0)
return StatusCode::SUCCESS;
139 if(!trigTool.empty()) {
141 const int ABORT_GAP_START = 3446;
142 const int ABORT_GAP_END = 3563;
144 passBCID = ((trig_chain ==
"HLT_noalg_cosmiccalo_L1RD1_EMPTY")?(ctx.eventID().bunch_crossing_id() >= ABORT_GAP_START && ctx.eventID().bunch_crossing_id() <= ABORT_GAP_END):
true);
145 passTrig=(passTrig || (passBCID && trigTool->isPassed(trig_chain)));
149 ATH_MSG_INFO(
"Running as 'calibration run'. No trigger selection will be applied...");
154 return StatusCode::SUCCESS;
164 return StatusCode::FAILURE;
181 std::map<std::pair<HWIdentifier,unsigned>, std::vector<float> > div_array;
184 if(
m_processGroup[group]) div_array[std::make_pair(arr_entry,group)]=std::vector<float>();
191 for ( ; itDig!=itDig_e;++itDig) {
197 float pedestal = pedestals->
pedestal(
id,gain);
200 const std::vector<short>* digito = &pLArDigit->
samples();
209 if(div_array.count(std::make_pair(febID,group)) > 0) {
211 std::vector<float> &tmparr=div_array.at(std::make_pair(febID,group));
212 short sample=digito->at(2);
213 float sdiff = sample-pedestal;
215 tmparr.push_back(sdiff);
216 }
else if (group==1 && chan%2==0) {
217 tmparr.push_back(sdiff);
218 }
else if (group==2 && chan%2==1) {
219 tmparr.push_back(sdiff);
220 }
else if (group==3 && chan<64) {
221 tmparr.push_back(sdiff);
222 }
else if (group==4 && chan>63) {
223 tmparr.push_back(sdiff);
224 }
else if (group==5 && chan%2==0 && chan<64) {
225 tmparr.push_back(sdiff);
226 }
else if (group==6 && chan%2==1 && chan<64) {
227 tmparr.push_back(sdiff);
228 }
else if (group==7 && chan%2==0 && chan>63) {
229 tmparr.push_back(sdiff);
230 }
else if (group==8 && chan%2==1 && chan>63) {
231 tmparr.push_back(sdiff);
232 }
else if (group==9 && chan<32) {
233 tmparr.push_back(sdiff);
234 }
else if (group==10 && chan>31 && chan<64) {
235 tmparr.push_back(sdiff);
236 }
else if (group==11 && chan>63 && chan<96) {
237 tmparr.push_back(sdiff);
238 }
else if (group==12 && chan>95) {
239 tmparr.push_back(sdiff);
242 catch (
const std::out_of_range& oor) {
257 for(
auto const& feb_entry :
m_febMap) {
258 std::string febstr =
febString(feb_entry);
265 return StatusCode::SUCCESS;
276 return eb+ac+Form(
"ft%02d",FT)+Form(
"slot%02d",SL);
282 for(
auto it : *input_vector) tmean += it;
283 tmean = tmean / input_vector->size();
284 for(
auto it : *input_vector) tdiv += (tmean - it)*(tmean - it);
285 tdiv = tdiv / input_vector->size();
290 for(
auto it : *input_vector) tsum += it;
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
virtual StatusCode initialize() override
initialize
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
std::vector< std::string > m_vTrigChainNames
Vector of trigger chain names parsed from trigger chain string.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
DataModel_detail::const_iterator< DataVector > const_iterator
virtual float pedestal(const HWIdentifier &id, int gain) const =0
Gaudi::Property< std::vector< std::string > > m_groupNames
std::vector< HWIdentifier > m_febMap
double calc_sum_dev(std::vector< float > *input_vector) const
virtual StatusCode initialize() override
initialize
SG::ReadCondHandleKey< ILArPedestal > m_keyPedestal
Handle to pedestal.
double calc_dev(std::vector< float > *input_vector) const
virtual ~LArCoherentNoisefractionMonAlg()
Default destructor.
Gaudi::Property< std::vector< std::string > > m_FEBlist
SG::ReadHandleKey< LArDigitContainer > m_LArDigitContainerKey
Handle to digits.
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Gaudi::Property< std::vector< bool > > m_processGroup
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Handle to cabling.
std::vector< std::map< std::string, int > > m_histoGroups
the group array
Gaudi::Property< std::vector< unsigned > > m_groupNChan
Gaudi::Property< bool > m_isCalibrationRun
to avoid asking for triggers in case of a calibration run
std::string febString(const HWIdentifier) const
build the FEB string, following instructions from python config
const LArOnlineID * m_LArOnlineIDHelper
services
LArCoherentNoisefractionMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
Liquid Argon digit base class.
CaloGain::CaloGain gain() const
const HWIdentifier & hardwareID() const
const std::vector< short > & samples() const
Declare a monitored scalar variable.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
std::vector< V > buildToolMap(const ToolHandleArray< GenericMonitoringTool > &tools, const std::string &baseName, int nHist)
Builds an array of indices (base case)