CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
EcalUncalibRecHitRecWeightsAlgo< C > Class Template Reference

#include <EcalUncalibRecHitRecWeightsAlgo.h>

Public Member Functions

virtual EcalUncalibratedRecHit makeRecHit (const C &dataFrame, const double *pedestals, const double *pedestalsRMS, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalShapeBase &testbeamPulseShape)
 Compute parameters. More...
 
virtual ~EcalUncalibRecHitRecWeightsAlgo ()
 

Detailed Description

template<class C>
class EcalUncalibRecHitRecWeightsAlgo< C >

Template used to compute amplitude, pedestal, time jitter, chi2 of a pulse using a weights method

Id:
EcalUncalibRecHitRecWeightsAlgo.h,v 1.14 2012/05/13 21:00:57 argiro Exp
Date:
2012/05/13 21:00:57
Revision:
1.14
Author
R. Bruneliere - A. Zabi

The chi2 computation with matrix is replaced by the chi2express which is moved outside the weight algo (need to clean up the interface in next iteration so that we do not pass-by useless arrays)

Template used to compute amplitude, pedestal, time jitter, chi2 of a pulse using a weights method

Id:
EcalUncalibRecHitWorkerWeights.h,v 1.2 2009/10/19 19:00:58 theofil Exp
Date:
2009/10/19 19:00:58
Revision:
1.2
Author
R. Bruneliere - A. Zabi

Definition at line 26 of file EcalUncalibRecHitRecWeightsAlgo.h.

Constructor & Destructor Documentation

template<class C>
virtual EcalUncalibRecHitRecWeightsAlgo< C >::~EcalUncalibRecHitRecWeightsAlgo ( )
inlinevirtual

Definition at line 30 of file EcalUncalibRecHitRecWeightsAlgo.h.

30 { };

Member Function Documentation

template<class C>
virtual EcalUncalibratedRecHit EcalUncalibRecHitRecWeightsAlgo< C >::makeRecHit ( const C &  dataFrame,
const double *  pedestals,
const double *  pedestalsRMS,
const double *  gainRatios,
const EcalWeightSet::EcalWeightMatrix **  weights,
const EcalShapeBase testbeamPulseShape 
)
inlinevirtual

Compute parameters.

Definition at line 33 of file EcalUncalibRecHitRecWeightsAlgo.h.

Referenced by EcalTBWeightUncalibRecHitProducer::produce(), EcalUncalibRecHitWorkerWeights::run(), and EcalUncalibRecHitWorkerGlobal::run().

40  {
41  double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.);
42  uint32_t flag = 0;
43 
44 
45  // Get time samples
46  ROOT::Math::SVector<double,C::MAXSAMPLES> frame;
47  int gainId0 = 1;
48  int iGainSwitch = 0;
49  bool isSaturated = 0;
50  for(int iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
51  int gainId = dataFrame.sample(iSample).gainId();
52  //Handling saturation (treating saturated gainId as maximum gain)
53  if ( gainId == 0 )
54  {
55  gainId = 3;
56  //isSaturated = 1;
57  // in pileup run May2012 samples 7,8,9,10 have gainid ==0
58  // fix it like this: it won't hurt for the future SA20120512
59  if(iSample==4 || iSample ==5 || iSample==6) isSaturated = 1;
60  }
61 
62  // if (gainId != gainId0) iGainSwitch = 1;
63  // same problem as above: mark saturation only when physically
64  // expected to occur SA20120513
65  if ( (gainId != gainId0) && (iSample==4 || iSample ==5 || iSample==6) ) iGainSwitch = 1;
66  if (!iGainSwitch)
67  frame(iSample) = double(dataFrame.sample(iSample).adc());
68  else
69  frame(iSample) = double(((double)(dataFrame.sample(iSample).adc()) - pedestals[gainId-1]) * gainRatios[gainId-1]);
70  }
71 
72  // Compute parameters
73  ROOT::Math::SVector <double,3> param = (*(weights[iGainSwitch])) * frame;
76  if (amplitude_) jitter_ = param(EcalUncalibRecHitRecAbsAlgo<C>::iTime);
77 
78 
79  //When saturated gain flag i
80  if (isSaturated)
81  {
83  amplitude_ = double((4095. - pedestals[2]) * gainRatios[2]);
84  }
85  return EcalUncalibratedRecHit( dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_, flag);
86  }
long int flag
Definition: mlp_lapack.h:47
int gainId(sample_type sample)
get the gainId (2 bits)
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)