Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:09

0001 /*
0002  * $Id: EcalSRSettings.h,v 1.1 2010/06/09 14:23:32 pgras Exp $
0003  *
0004  * Original author: Ph. Gras CEA/IRFU Saclay.  June, 2010
0005  *
0006  */
0007 
0008 #ifndef ECALSRSETTINGS_H
0009 #define ECALSRSETTINGS_H
0010 
0011 #include "CondFormats/Serialization/interface/Serializable.h"
0012 
0013 #include <vector>
0014 #include <string>
0015 #include <ostream>
0016 
0017 /** Class to hold ECAL Selective readout settings.
0018  * Up to CMSSW release 3.8.X, selective readout emulation settings was done from
0019  * CMSSW configuration file. From 3.8.X configuration is stored in condition database.
0020  * Support for configuration from CMSSW configuration file is maintained, for backward
0021  * compatibility and to provide an easy way to change settings for studies dedicated to
0022  * seletive readout. The same object is used to stored the online setting of real data.
0023  *
0024  * Tools to manipulate this object can be found in class EcalSRCondTools of package
0025  * SimCalorimetry/EcalSelectiveReadoutProducer.
0026  */
0027 class EcalSRSettings {
0028   //constructor(s) and destructor(s)
0029 public:
0030   /** Constructs an EcalSRSettings
0031    */
0032   EcalSRSettings();
0033 
0034   /**Destructor
0035    */
0036   virtual ~EcalSRSettings(){};
0037 
0038   //method(s)
0039 public:
0040 private:
0041   //attribute(s)
0042 protected:
0043 private:
0044 public:
0045   static const int nSrps_ = 12;
0046   static const int nDccs_ = 54;
0047   static const int nTccs_ = 108;
0048 
0049   /// Neighbour eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)
0050   /// In the vector contains:
0051   ///   - 1 element, then value applies to whole ECAL
0052   ///   - 2 elements, then element 0 applies to EB, element 1 to EE
0053   ///   - 12 elements, then element i applied to SRP (i+1)
0054   /// SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports
0055   /// only 1 element mode.
0056   std::vector<int> deltaEta_;
0057 
0058   /// Neighbouring eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)
0059   /// If the vector contains...
0060   ///   ... 1 element, then value applies to whole ECAL
0061   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0062   ///   ... 12 elements, then element i applied to SRP (i+1)
0063   /// If the vector contains...
0064   ///   ... 1 element, then value applies to whole ECAL
0065   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0066   ///   ... 12 elements, then element i applied to SRP (i+1)
0067   /// SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports
0068   /// only the single-element mode.
0069   std::vector<int> deltaPhi_;
0070 
0071   /// Index of time sample (staring from 1) the first DCC weights is implied
0072   /// If the vector contains:
0073   ///   ... 1 element, then value applies to whole ECAL
0074   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0075   ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0076   /// SRP emulation (see SimCalorimetry/EcalSelectiveReadoutProcuders) supports
0077   /// only the single-element mode.
0078   std::vector<int> ecalDccZs1stSample_;
0079 
0080   /// ADC to GeV conversion factor used in ZS filter for EB
0081   float ebDccAdcToGeV_;
0082   /// ADC to GeV conversion factor used in ZS filter for EE
0083   float eeDccAdcToGeV_;
0084 
0085   ///DCC ZS FIR weights: weights are rounded in such way that in Hw
0086   ///representation (weigth*1024 rounded to nearest integer) the sum is null:
0087   ///Each element is a vector of 6 values, the 6 weights
0088   /// If the vector contains...
0089   ///   ... 1 element, then the weight set applies to whole ECAL
0090   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0091   ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0092   ///   ... 75848 elements, then:
0093   ///            for i < 61200, element i applies to EB crystal with denseIndex i
0094   ///                           (see EBDetId::denseIndex())
0095   ///            for i >= 61200, element i applies to EE crystal with denseIndex (i+61200)
0096   ///                           (see EBDetId::denseIndex())
0097   std::vector<std::vector<float> > dccNormalizedWeights_;
0098 
0099   /// Switch to use a symetric zero suppression (cut on absolute value). For
0100   /// studies only, for time being it is not supported by the hardware.
0101   /// having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead,
0102   /// 0 means false, a value different than 0 means true.
0103   /// If the vector contains...
0104   ///   ... 1 element, then the weight set applies to whole ECAL
0105   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0106   ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0107   /// SRP emulation supports only 1 element mode. Hardware does not support
0108   /// the symetric ZS, so symetricZS = 0 for real data.
0109   std::vector<int> symetricZS_;
0110 
0111   /// ZS energy threshold in GeV to apply to low interest channels of barrel
0112   /// If the vector contains...
0113   ///   ... 1 element, then the weight set applies to whole ECAL
0114   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0115   ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0116   /// SRP emulation supports only the 2-element mode.
0117   /// Corresponds to srpBarrelLowInterestChannelZS and srpEndcapLowInterestChannelZS
0118   /// of python configuration file parameters
0119   std::vector<float> srpLowInterestChannelZS_;
0120 
0121   /// ZS energy threshold in GeV to apply to high interest channels of endcap
0122   /// If the vector contains...
0123   ///   ... 1 element, then the weight set applies to whole ECAL
0124   ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0125   ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0126   /// SRP emulation supports only the 2-element mode.
0127   /// Corresponds to srpBarrelLowInterestChannelZS and srpEndcapLowInterestChannelZS
0128   /// of python configuration file parameters
0129   std::vector<float> srpHighInterestChannelZS_;
0130 
0131   //  ///switch to run w/o trigger primitive. For debug use only
0132   //  ///having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead
0133   //  ///Parameter only relevant for emulation. For real data, must be contains 1 element with
0134   //  ///value 0.
0135   //  ///   ... 1 element, then the weight set applies to whole ECAL
0136   //  ///   ... 2 elements, then element 0 applies to EB, element 1 to EE
0137   //  ///   ... 54 elements, then element i applied to DCC (i+1) (FED ID 651+i)
0138   //  /// SRP emulation supports only the single-element mode.
0139   //  std::vector<int> trigPrimBypass_;
0140   //
0141   //  /// Mode selection for "Trig bypass" mode
0142   //  /// 0: TT thresholds applied on sum of crystal Et's
0143   //  /// 1: TT thresholds applies on compressed Et from Trigger primitive
0144   //  /// @see trigPrimByPass switch
0145   //  /// Parameter only relevant for
0146   //  std::vector<int> trigPrimBypassMode_;
0147   //
0148   //  ///for debug mode only:
0149   //  std::vector<float>  trigPrimBypassLTH_;
0150   //
0151   //  ///for debug mode only:
0152   //  std::vector<float>  trigPrimBypassHTH_;
0153   //
0154   //  ///for debug mode only
0155   //  ///having troubles for vector<bool> with coral (3.8.0pre1), using vector<int> instead
0156   //  std::vector<int>  trigPrimBypassWithPeakFinder_;
0157   //
0158   //  ///Trigger Tower Flag to use when a flag is not found from the input
0159   //  ///Trigger Primitive collection. Must be one of the following values:
0160   //  /// 0: low interest, 1: mid interest, 3: high interest
0161   //  /// 4: forced low interest, 5: forced mid interest, 7: forced high interest
0162   //  std::vector<int> defaultTtf_;
0163 
0164   /// SR->action flag map. 4 elements
0165   /// action_[i]: action for flag value i
0166   std::vector<int> actions_;
0167 
0168   ///Masks for TTC inputs of SRP cards
0169   ///One element per TCC, that is 108 elements: element i applies to TCC (i+1)
0170   std::vector<short> tccMasksFromConfig_;
0171 
0172   ///Masks for SRP-SRP inputs of SRP cards
0173   ///One element per SRP, that is 12 elements: element i applies to SRP (i+1)
0174   // indices: [iSrp][iCh]
0175   std::vector<std::vector<short> > srpMasksFromConfig_;
0176 
0177   ///Masks for DCC output of SRP cards
0178   ///One element per DCC, that is 54 elements: element i applies to DCC (i+1)
0179   std::vector<short> dccMasks_;
0180 
0181   ///Mask to enable pattern test. Typical value: 0.
0182   ///One element per SRP, that is 12 elements: element i applies to SRP (i+1)
0183   std::vector<short> srfMasks_;
0184 
0185   ///Substitution flags used in patterm mode
0186   ///indices [iSrp][iFlag]
0187   std::vector<std::vector<short> > substitutionSrfs_;
0188 
0189   //@{
0190   ///Tester mode configuration
0191   /// 12 elements: index = (SRP ID - 1)
0192   std::vector<int> testerTccEmuSrpIds_;
0193   std::vector<int> testerSrpEmuSrpIds_;
0194   std::vector<int> testerDccTestSrpIds_;
0195   std::vector<int> testerSrpTestSrpIds_;
0196   //@}
0197 
0198   ///Per SRP card bunch crossing counter offset.
0199   ///This offset is added to the bxGlobalOffset
0200   /// 12 elements: index = (SRP ID - 1)
0201   std::vector<short> bxOffsets_;
0202 
0203   ///SRP system bunch crossing counter offset.
0204   ///For each card the bxOffset[i] (typ. value 0)
0205   //is added to this one.
0206   short bxGlobalOffset_;
0207 
0208   /// Switch for automatic channel masking. 0: disabled; 1: enabled. Standard  configuration: 1.
0209   /// When enabled, if a FED is excluded from the run, the corresponding TCC inputs is automatically
0210   /// masked (overwrites the tccInputMasks).
0211   int automaticMasks_;
0212 
0213   /// Switch for automatic SRP card selection. 0: disabled; 1 : enabled..
0214   ///When enabled, if all the FEDs corresponding to a given SRP is excluded from the run,
0215   ///Then the corresponding SRP card is automatically excluded.
0216   int automaticSrpSelect_;
0217 
0218   COND_SERIALIZABLE;
0219 };
0220 
0221 std::ostream& operator<<(std::ostream& o, const EcalSRSettings& val);
0222 
0223 #endif  //ECALSRSETTINGS_H not defined