DTTMax

InfoLayer

SegDir

SigmaFactor

TMax

TMaxCells

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
#ifndef DTTMax_H
#define DTTMax_H

/** \class DTTMax
 *  Class to calculate the different TMax values according to
 *  the track path
 *

 *  \author Marina Giunta
 */

#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "Histogram.h"

#include <string>
#include <vector>

class DTSuperLayer;
class DTSuperLayerId;
class DTTTrigBaseSync;

namespace dttmaxenums {
  enum TMaxCells { c123, c124, c134, c234, notInit };
  enum SigmaFactor { r32, r72, r78, noR };
  enum SegDir { L, R };
}  // namespace dttmaxenums

class DTTMax {
public:
  typedef dttmaxenums::TMaxCells TMaxCells;
  typedef dttmaxenums::SegDir SegDir;
  typedef dttmaxenums::SigmaFactor SigmaFactor;

  /// Constructor
  DTTMax(const std::vector<DTRecHit1D>& hits,
         const DTSuperLayer& isl,
         GlobalVector dir,
         GlobalPoint pos,
         const DTTTrigBaseSync& sync,
         dtcalibration::Histograms& hist);

  /// Destructor
  virtual ~DTTMax();

  /// Information on each of the four TMax values in a SL
  struct TMax {
    TMax(float t_, TMaxCells cells_, std::string type_, SigmaFactor sigma_, unsigned t0Factor_, unsigned hSubGroup_)
        : t(t_), cells(cells_), type(type_), sigma(sigma_), t0Factor(t0Factor_), hSubGroup(hSubGroup_) {}

    float t;
    TMaxCells cells;
    std::string type;    // LLR, LRL,...
    SigmaFactor sigma;   // factor relating the width of the Tmax distribution
                         // and the cell resolution
    unsigned t0Factor;   // "quantity" of Delta(t0) included in the tmax formula
    unsigned hSubGroup;  //different t0 hists (one hit within a given distance from the wire)
  };

  // All information on one of the layers crossed by the segment
  struct InfoLayer {
    InfoLayer(
        const DTRecHit1D& rh_, const DTSuperLayer& isl, GlobalVector dir, GlobalPoint pos, const DTTTrigBaseSync& sync);
    DTRecHit1D rh;
    DTWireId idWire;
    DTEnums::DTCellSide lr;
    float wireX;
    float time;
  };

  // Return the three TMax for a given cell
  std::vector<const TMax*> getTMax(const DTWireId& idWire);

  // Return the four TMaxes of the SL
  std::vector<const TMax*> getTMax(const DTSuperLayerId& isl);

  // Return one of the four TMaxes of the SL
  const TMax* getTMax(TMaxCells cCase);

  // Get InfoLayer (r/w) from layer number
  InfoLayer*& getInfoLayer(int layer) { return theInfoLayers[layer - 1]; }

private:
  DTTMax() {}  // Hide default constructor

  //debug flag
  bool debug;

  std::vector<InfoLayer*> theInfoLayers;
  std::vector<TMax*> theTMaxes;
  SegDir theSegDir;
  std::string theSegType;  // LRLR, LRLL, ....
};
#endif