Commit e0ed235f authored by Siarhei Harkusha's avatar Siarhei Harkusha Committed by Graeme Stewart
Browse files

Added possibility to monitor gap laser (TileMonitoring-00-07-12)

parent ce0fdca7
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file PairBuilder.h
* Contains class declaration for PairBuilder,
* and overloaded "operator <<" for output of same.
*
* @author Shaun Roe
* @date Sat Apr 10 2004.
*
*/
#ifndef PairBuilder_H
#define PairBuilder_H
#include <vector>
#include <utility>
#include <ostream>
#include <set>
/** @class PairBuilder
* @brief Class to build pairs of XY values.
*
* Given a sequence of x and y integer values,
* PairBuilder will make all possible XY pairs
* and return the pairs in vector.
*/
class PairBuilder {
public:
PairBuilder();
~PairBuilder();
typedef std::pair<int, int> XYPair;
typedef std::vector< XYPair > PairVector;
typedef std::set<int> IntSet;
/// Input a new x value
void inputx(const int xstrip);
/// Input a new y value
void inputy(const int ystrip);
/// Input a new y value
void inputxy(const int ystrip);
/// Return the number of XY pairs made
int numberOfPairs() const;
/// Return the pairs as a vector of pairs of integers
PairVector pairs() const;
/// Return the 'weight', = 1/(number of pairs)
float weight() const;
/// Return a specific XY pair at some vector index
XYPair pairAtIndex(const int indx) const;
/// Return the X value of a specific pair
int xOfPairAt(const int indx) const;
/// Return the Y value of a specific pair
int yOfPairAt(const int indx) const;
private:
/** @name Sets to hold x values and y values. */
//@{
IntSet m_yvalues;
/// use sets to avoid duplicate values
IntSet m_xvalues;
//@}
///Vector to hold the pairs produced.
PairVector m_pairs;
/** @name Functions which form the pairs. */
//@{
void formNewPairsWithX(const int xval);
void formNewPairsWithY(const int yval);
//@}
};
///Overloaded "operator <<" for output of PairBuilder objects
std::ostream& operator<< (std::ostream& os, const PairBuilder& e);
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ********************************************************************
//
// NAME: TileCellMonTool.h
// PACKAGE: TileMonitoring
//
// AUTHORS: Alexander Solodkov
// Luca Fiorini (Luca.Fiorini@cern.ch)
//
// ********************************************************************
#ifndef TILECELLMONTOOL_H
#define TILECELLMONTOOL_H
#include "TileMonitoring/TileFatherMonTool.h"
/** @class TileCellMonTool
* @brief Class for TileCell based monitoring
*/
class TProfile;
class TProfile2D;
class TileCell;
class ITileBadChanTool;
class TileCellMonTool: public TileFatherMonTool {
public:
TileCellMonTool(const std::string & type, const std::string & name, const IInterface* parent);
~TileCellMonTool();
StatusCode initialize();
//pure virtual methods
StatusCode bookHistograms();
StatusCode fillHistograms();
StatusCode procHistograms();
StatusCode checkHists(bool fromFinalize);
StatusCode bookHistTrig(int trig);
StatusCode bookHistTrigPart(int trig, int part);
void cleanHistVec();
private:
void calculateSynch();
short isCellBad(const TileCell* tile_cell);
short isAdcBad(int partition, int module, int channel, int gain);
short nAdcBad(int partition);
void FirstEvInit();
void ShiftLumiHist(TProfile2D*, int32_t);
ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool
bool m_doOnline;
double m_Threshold;
double m_NegThreshold;
double m_ThresholdForTime;
double m_EneBalThreshold;
double m_TimBalThreshold;
int32_t m_TileCellTrig;
int32_t m_old_lumiblock;
int32_t m_delta_lumiblock;
int32_t m_OldLumiArray1[4][64][4];
int32_t m_OldLumiArray2[4][64][4];
std::string m_cellsContName;
std::vector<const CaloCell*> m_muonCells;
std::vector<std::string> m_cellchLabel[NumPart]; // array of cell-channels names
std::vector<std::string> m_moduleLabel[NumPart]; // array of modules names
bool m_isFirstEv;
//std::vector<TH2I*> m_TileCellEtaPhiOvThr;
//std::vector<TH1I*> m_TileCellPhiOvThr;
//std::vector<TH1I*> m_TileCellEtaOvThr;
//std::vector<TProfile2D*> m_TileCellEneEtaPhi;
//std::vector<TProfile*> m_TileCellEneEta;
//std::vector<TProfile*> m_TileCellEnePhi;
// histograms per samplings
std::vector<TH2I*> m_TileCellEtaPhiOvThrSamp[TotalSamp];
std::vector<TProfile2D*> m_TileCellEneEtaPhiSamp[TotalSamp];
//detailed occupancy plots at the channel level
std::vector<TH2F*> m_TileCellDetailOccMapOvThr[NPartHisto];
std::vector<TH2F*> m_TileCellDetailOccMapOvThr30GeV[NPartHisto];
std::vector<TH2F*> m_TileCellDetailOccMapOvThr300GeV[NPartHisto];
std::vector<TProfile2D*> m_TileCellDetailOccMap[NPartHisto];
// energy and time balance in module number vs partition
//std::vector<TProfile2D*> m_TileCellOccModPart;
//std::vector<TH2I*> m_TileCellOccModPartOvThr;
// histograms per samplings
//std::vector<TProfile2D*> m_TileCellOccModPartSamp[TotalSamp];
//std::vector<TH2I*> m_TileCellOccModPartOvThrSamp[TotalSamp];
// energy and time balance in module number vs partition
std::vector<TH2S*> m_TileCellEneBalModPart;
std::vector<TH2S*> m_TileCellTimBalModPart;
TProfile* m_TileCellEneBal[NumPart];
TProfile* m_TileCellTimBal[NumPart];
TH2S* m_TileCellStatFromDB[NumPart][2]; //partitions and gains
TH2F* m_TileCellStatOnFly[NumPart]; //partitions
TH2F* m_TileCellDetailNegOccMap[NumPart]; //partitions
TProfile* m_TileBadCell; //number of bad cells per partition
TProfile* m_TileMaskCellonFlyLumi[NPartHisto]; // number of masked cells as function of lumi_block
TProfile* m_TileMaskChannonFlyLumi[NPartHisto]; // number of masked channels as function of lumi_block
TProfile* m_TileMaskChannfromDBLumi[NPartHisto]; // number of masked channels as function of lumi_block
std::vector<TH1F*> m_TileCellSynch;
//Pointers to 1DHistograms of Event Energy divided per sample and integrated
std::vector<TH1F*> m_TileCellEneDiffSamp[NPartHisto][TotalSamp];
//std::vector<TH1F*> m_TileCellEneRatSamp[NPartHisto][TotalSamp];
std::vector<TH1F*> m_TileCellTimeDiffSamp[NPartHisto][TotalSamp];
std::vector<TH1F*> m_TileCellEvEneSamp[NPartHisto][TotalSamp];
//std::vector<TH1F*> m_TilenCells[NPartHisto];
std::vector<TProfile*> m_TilenCellsLB[NPartHisto];
std::vector<TH2F*> m_TileCellModuleCorr[NPartHisto];
//std::vector<TH1F*> m_TileCellTime[NPartHisto];
//std::vector<TH1F*> m_TileCellEnergy[NPartHisto];
//std::vector<TH1F*> m_TileCellEnergyRebin[NPartHisto];
std::vector<TProfile*> m_TileCellEvEneTim[NPartHisto];
std::vector<TProfile*> m_TileCellEvEneLumi[NPartHisto];
//std::vector<TH1F*> m_TileCellEvEneRebin[NPartHisto];
std::vector<TProfile*> m_TileCellOccOvThrBCID[NPartHisto]; // last element not used, but we keep the same size of the others histograms to speed-up loops and avoid
//std::vector<TProfile*> m_TileCellOccEneBCID[NPartHisto]; // to have too many 'ifs' that are error-prone.
//std::vector<TH1F*> m_TileEventsPerBCID;
//std::vector<TH1F*> m_TileChanDetTime; // One for entire detector.
std::vector<TProfile2D*> m_TileChanPartTime[4]; // One for each partition.
std::vector<TProfile2D*> m_TileDigiPartTime[4]; // One for each partition.
//std::vector<TProfile*> m_TileChanModTime[4]; // One for each partition.
//std::vector<TProfile*> m_TileChanChTime[4][64]; // One for each module
// in each partition.
std::vector<TProfile2D*> m_TileDigiEnergyLB[4][64];
std::vector<TProfile2D*> m_TileDigiTimeLB[4][64];
// TH2D* m_test;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ********************************************************************
//
// NAME: TileCellNoiseMonTool.h
// PACKAGE: TileMonitoring
//
// AUTHORS: Christophe Clement
//
// ********************************************************************
#ifndef TILECELLNOISEMONTOOL_H
#define TILECELLNOISEMONTOOL_H
#include "TileMonitoring/TileFatherMonTool.h"
class TProfile;
class TProfile2D;
class ITileBadChanTool;
class TileCellNoiseMonTool: public TileFatherMonTool {
public:
TileCellNoiseMonTool(const std::string & type, const std::string & name,
const IInterface* parent);
~TileCellNoiseMonTool();
StatusCode initialize();
//pure virtual methods
StatusCode bookHistograms();
StatusCode fillHistograms();
StatusCode procHistograms();
StatusCode checkHists(bool fromFinalize);
StatusCode finalHists();
StatusCode bookCellNoiseHistos();
StatusCode fillHistoPerCell();
void do2GFit(); // perform double gaussian fit
void do2GFit(TH1F* h, double *, TF1 *); // perform double gaussian fit
void cleanHistVec();
private:
void FirstEvInit();
ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool
bool m_doOnline;
int32_t m_TileCellTrig;
int32_t m_old_lumiblock;
int32_t m_delta_lumiblock;
std::string m_cellsContName;
std::string m_cellnoise_histo_path;
bool m_isFirstEv;
// x-axis range for the individual cell noise histograms
float m_xmin;
float m_xmax;
std::vector<TH1F*> m_TileCellEne[4][64]; // a 2D array of 4x64 partitions X modules, each containing a vector of cells
TH2F* m_map_sigma1[4];
TH2F* m_map_sigma2[4];
TH2F* m_map_R[4];
TH2F* m_map_chi2[4];
TH2F* m_map_chi2prb[4];
TH2F* m_map_rmsOsig[4];
TH2F* m_map_rms[4];
TH1F* h_partition1;
TH1F* h_partition2;
TH2F* h2_partition0;
TH2F* h2_partition1;
TH2F* h2_partition2;
TH2F* h2_partition3;
// TH2D* m_test;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ********************************************************************
//
// NAME: TileToweMonTool.h
// PACKAGE: TileMonitoring
//
// AUTHOR: Luca Fiorini (Luca.Fiorini@cern.ch)
//
//
// ********************************************************************
#ifndef TILECLUSTERMONTOOL_H
#define TILECLUSTERMONTOOL_H
#include "TileMonitoring/TileFatherMonTool.h"
/** @class TileClusterMonTool
* @brief Class for TileCluster based monitoring
*/
class TProfile;
class TProfile2D;
class TileClusterMonTool: public TileFatherMonTool {
public:
TileClusterMonTool(const std::string & type, const std::string & name, const IInterface* parent);
~TileClusterMonTool();
StatusCode initialize();
//pure virtual methods
StatusCode bookHistograms();
StatusCode fillHistograms();
StatusCode procHistograms();
StatusCode checkHists(bool fromFinalize);
StatusCode bookHistTrig(int trig);
void cleanHistVec(); //necessary to avoid problems at the eb, lumi blocks boundaries
private:
int32_t m_TileClusterTrig;
double m_Threshold;
std::string m_clustersContName;
std::vector<TH1F*> m_TilenClusters;
std::vector<TH1F*> m_TileClusternCells;
std::vector<TH1F*> m_TileClusterEnergy[NPartHisto];
//std::vector<TH1F*> m_TileClusterEnergyRebin[NPartHisto];
//std::vector<TProfile*> m_TileClusterEneTim;
std::vector<TProfile*> m_TileClusterEneLumi;
//std::vector<TH1F*> m_TileClusterTime;
std::vector<TH1F*> m_TileClusterEt;
std::vector<TH2F*> m_TileClusterEtaPhi;
//std::vector<TH1F*> m_TileClusterEta;
//std::vector<TH1F*> m_TileClusterPhi;
std::vector<TProfile*> m_TileClusterEneEta;
std::vector<TProfile*> m_TileClusterEnePhi;
std::vector<TProfile2D*> m_TileClusterEneEtaPhi;
std::vector<TH2F*> m_TileClusterAllEtaPhi;
std::vector<TH2F*> m_TileClusterEtaPhiDiff;
std::vector<TH1F*> m_TileClusterEneDiff;
std::vector<TH1F*> m_TileClusterTimeDiff;
std::vector<TH1F*> m_TileAllClusterEnergy;
//std::vector<TH1F*> m_TileClusterEnergyOvThr;
std::vector<TH1F*> m_TileClusterSumEt;
std::vector<TH1F*> m_TileClusterSumPx;
std::vector<TH1F*> m_TileClusterSumPy;
// TH2D* m_test;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ********************************************************************
//
// NAME: TileDQFragMonTool.h
// PACKAGE:
//
// AUTHOR: Natanael Nunes de Moura Junior
//
//
// ********************************************************************
#ifndef TILERAWCHANNELMONTOOL_H
#define TILETAWCHANNELMONTOOL_H
#include "TileMonitoring/TileFatherMonTool.h"
//
#include <stdint.h>
#include <vector>
#define NERR 13
#define NCORRUPTED 13
#define NDMU 16
class TileBeamInfoProvider;
class TileDigitsCollection;
class TileRawChannelCollection;
class TileDQstatus;
class ITileBadChanTool;
class TileDCSSvc;
class TileRawChannel;
class TileDigits;
/** @class TileDQFragMonTool
* @brief Class for commissioning: dq fragment monitoring
*/
class TileDQFragMonTool: public TileFatherMonTool {
public:
TileDQFragMonTool(const std::string & type, const std::string & name, const IInterface* parent);
~TileDQFragMonTool();
StatusCode initialize();
//pure virtual methods
/*---------------------------------------------------------*/
/* njunior@cern.ch */
StatusCode bookHistograms();
StatusCode fillHistograms();
StatusCode procHistograms();
void bookErrHist(int ros, int drawer);
void fillErrHist(int ros, int drawer);
void drawErrHist(int ros, int drawer);
void fillGlobalHist(int ros, int drawer);
void drawGlobalHist();
void updateHistograms();
void endErrHist();
void rebin(TH2I*);
/*---------------------------------------------------------*/
private:
void bookFirstHist();
void fillMasking();
void fillOneErrHist(int, int, int, int);
bool CheckhasErr(int ros, int drawer, int dmu);
bool isModuleDCSgood(int partition, int drawer) const;
int findDrawerErrors(const TileRawChannelCollection *coll);
int findChannelErrors(const TileRawChannel *rch, int & gain);
void fillBadDrawer(void);
ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool
ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc
ToolHandle<TileBeamInfoProvider> m_beamInfo;
/*---------------------------------------------------------*/
/* properties*/
std::string m_contNameDSP;
std::string m_contNameOffline;
std::string m_contNameDigits;
float m_negAmpHG;
float m_negAmpLG;
float m_jumpDeltaHG;
float m_jumpDeltaLG;
float m_pedDeltaHG;
float m_pedDeltaLG;
bool m_skipMasked;
bool m_skipGapCells;
bool m_doPlots;
bool m_doOnline;
bool m_checkDCS; //!< if false, do not use TileDCSSvc at all
/* njunior@cern.ch */
const TileDQstatus* dqStatus;
int m_UpdateCount;
int m_UpdateCount_shadow[10];
int m_Update;
int m_UpdateTotal;
// int m_dmu_map[16][3]; // not used
uint32_t m_last_lb;
//bool m_UpFlag = false;
int globalErrCount[4][64]; //global CRC errors
std::string errorDir;
/* njunior@cern.ch */
TH2I* hist_error[4][64];
TH2I* hist_error_shadow[4][64][10];
TH2I* hist_global[2];
//TH1I* hist_summary[4];
//TH1I* hist_BadDrawerBCID;
//TProfile* hist_BadDrawerBCID_lb;
//TH1I* hist_BadChanNeg[2];
//TProfile* hist_BadChanNeg_lb[2];
//TH1I* hist_BadDrawerJump;
//TProfile* hist_BadDrawerJump_lb;
TH2S* hist_BadChannelJump2D[4];
TH2S* hist_BadChannelNeg2D[4];
//TH1I* hist_BadDrawerBCID_nonmask;
//TProfile* hist_BadDrawerBCID_lb_nonmask;
//TH1I* hist_BadChanNeg_nonmask[2];
//TProfile* hist_BadChanNeg_lb_nonmask[2];
//TH1I* hist_BadDrawerJump_nonmask;
//TProfile* hist_BadDrawerJump_lb_nonmask;
TH2S* hist_BadChannelJump2D_nonmask[4];
TH2S* hist_BadChannelNeg2D_nonmask[4];
std::vector<std::string> m_ErrorsLabels, m_PartitionsLabels;
std::vector<std::string> m_moduleLabel[NumPart]; // array of module names
std::vector<std::string> m_cellchLabel[NumPart]; // array of cell-channels names
TProfile* hist_error_lb[4][64];
/*---------------------------------------------------------*/
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// ********************************************************************
//
// NAME: TileDigiNoiseMonTool.h
// PACKAGE:
//
// AUTHOR: Christophe Clement
//
//
// ********************************************************************
#ifndef TILEDIGINOISEMONTOOL_H
#define TILEDIGINOISEMONTOOL_H
#include "GaudiKernel/ToolHandle.h"
//#include "TileMonitoring/TilePaterMonTool.h"
#include "TileMonitoring/TileFatherMonTool.h"
#include <vector>
#include <stdint.h>
class TileBeamInfoProvider;
/** @class TileDigitsMonTool
* @brief Class for commissioning: digits histograms
*/
//class TileDigiNoiseMonTool : public TilePaterMonTool
class TileDigiNoiseMonTool: public TileFatherMonTool {
public:
TileDigiNoiseMonTool(const std::string & type, const std::string & name,
const IInterface* parent);
~TileDigiNoiseMonTool();
StatusCode initialize();
//pure virtual methods
StatusCode bookHists();