CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalLaserAnalyzerYousi Class Reference

#include <CalibCalorimetry/EcalLaserAnalyzerYousi/src/EcalLaserAnalyzerYousi.cc>

Inheritance diagram for EcalLaserAnalyzerYousi:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EcalLaserAnalyzerYousi (const edm::ParameterSet &)
 
 ~EcalLaserAnalyzerYousi () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

TH2F * APD
 
TH1F * APD_LM [9]
 
TH2F * APD_RMS
 
TH2F * APDPN
 
TH2F * APDPN_C
 
TH2F * APDPN_J
 
TH2F * APDPN_J_H [2]
 
TH2F * APDPN_J_LM [9]
 
TH1F * APDPN_LM [9]
 
TH2F * APDPN_RMS
 
TH1F * C_APD [1700]
 
TH1F * C_APDPN [1700]
 
TH2F * C_APDPN_J [1700]
 
TH1F * C_J [1700]
 
TH1F * C_PN [1700]
 
TNtuple * C_Tree [1700]
 
TH2F * Count
 
std::string digiProducer_
 
TFile * fAPD
 
TH1F * FitHist
 
TFile * fPN
 
TFile * fROOT
 
std::string hitCollection_
 
std::string hitProducer_
 
std::string outFileName_
 
TH1F * peakAPD [2]
 
TH1F * peakAPDPN [2]
 
TH2F * PN
 
std::string PNdigiCollection_
 
std::string Run_
 
std::string SM_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 52 of file EcalLaserAnalyzerYousi.cc.

Constructor & Destructor Documentation

EcalLaserAnalyzerYousi::EcalLaserAnalyzerYousi ( const edm::ParameterSet iConfig)
explicit

Definition at line 119 of file EcalLaserAnalyzerYousi.cc.

References digiProducer_, edm::ParameterSet::getUntrackedParameter(), hitCollection_, hitProducer_, outFileName_, PNdigiCollection_, Run_, SM_, and AlCaHLTBitMon_QueryRunRegistry::string.

119  {
120  //now do what ever initialization is needed
121  //get the PN and AB file names
122  //get the output file names, digi producers, etc
123 
124  hitCollection_ = iConfig.getUntrackedParameter<std::string>("hitCollection");
125  hitProducer_ = iConfig.getUntrackedParameter<std::string>("hitProducer");
126  // PNFileName_ = iConfig.getUntrackedParameter<std::string>("PNFileName");
127  // ABFileName_ = iConfig.getUntrackedParameter<std::string>("ABFileName");
128  outFileName_ = iConfig.getUntrackedParameter<std::string>("outFileName");
129  SM_ = iConfig.getUntrackedParameter<std::string>("SM");
130  Run_ = iConfig.getUntrackedParameter<std::string>("Run");
131  digiProducer_ = iConfig.getUntrackedParameter<std::string>("digiProducer");
132  PNdigiCollection_ = iConfig.getUntrackedParameter<std::string>("PNdigiCollection");
133 }
T getUntrackedParameter(std::string const &, T const &) const
EcalLaserAnalyzerYousi::~EcalLaserAnalyzerYousi ( )
override

Definition at line 135 of file EcalLaserAnalyzerYousi.cc.

135  {
136  // do anything here that needs to be done at desctruction time
137  // (e.g. close files, deallocate resources etc.)
138 }

Member Function Documentation

void EcalLaserAnalyzerYousi::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 145 of file EcalLaserAnalyzerYousi.cc.

References gpuClustering::adc, APD_LM, APDPN_C, APDPN_J, APDPN_J_H, APDPN_J_LM, APDPN_LM, C_APD, C_APDPN, C_APDPN_J, C_J, C_PN, C_Tree, CN, digiProducer_, edm::EventID::event(), cppFunctionSkipper::exception, FitHist, edm::Event::getByLabel(), hitCollection_, hitProducer_, edm::EventBase::id(), dqmiolumiharvest::j, isotrackApplyRegressor::k, SiStripPI::max, peakAPD, peakAPDPN, PNdigiCollection_, makeMEIFBenchmarkPlots::sample, EcalDCCHeaderBlock::EcalDCCEventSettings::wavelength, and z.

145  {
146  using namespace edm;
147 
148  // if ( fPN->IsOpen() ) { edm::LogInfo("EcalLaserAnalyzerYousi") <<"fPN is open in analyze OKAAAAAAAAYYY \n\n"; }
149 
151  iEvent.getByLabel(digiProducer_, DCCHeaders);
152 
153  EcalDCCHeaderBlock::EcalDCCEventSettings settings = DCCHeaders->begin()->getEventSettings();
154 
155  int wavelength = settings.wavelength;
156 
157  // std::cout<<"wavelength: "<<wavelength<<"\n\n";
158 
159  if (wavelength != 0) {
160  return;
161  } //only process blue laser
162 
164 
165  try {
166  iEvent.getByLabel(hitProducer_, hitCollection_, hits);
167  // iEvent.getByType(hits);
168  } catch (std::exception &ex) {
169  LogError("EcalLaserAnalyzerYousi") << "Cannot get product: EBRecHitCollection from: " << hitCollection_
170  << " - returning.\n\n";
171  // return;
172  }
173 
175 
176  try {
177  // iEvent.getByLabel(hitProducer_, hits);
178  iEvent.getByLabel(digiProducer_, PNdigiCollection_, pndigis);
179  //iEvent.getByType( pndigis );
180  } catch (std::exception &ex) {
181  LogError("EcalLaserAnalyzerYousi") << "Cannot get product: EBdigiCollection from: "
182  << "getbytype"
183  << " - returning.\n\n";
184  // return;
185  }
186 
187  Float_t PN_amp[5];
188 
189  //do some averaging over each pair of PNs
190  for (int j = 0; j < 5; ++j) {
191  PN_amp[j] = 0;
192  for (int z = 0; z < 2; ++z) {
193  FitHist->Reset();
194  TF1 peakFit("peakFit", "[0] +[1]*x +[2]*x^2", 30, 50);
195  TF1 pedFit("pedFit", "[0]", 0, 5);
196 
197  for (int k = 0; k < 50; k++) {
198  FitHist->SetBinContent(k, (*pndigis)[j + z * 5].sample(k).adc());
199  }
200  pedFit.SetParameter(0, 750);
201  FitHist->Fit(&pedFit, "RQI");
202  Float_t ped = pedFit.GetParameter(0);
203 
204  Int_t maxbin = FitHist->GetMaximumBin();
205  peakFit.SetRange(FitHist->GetBinCenter(maxbin) - 4 * FitHist->GetBinWidth(maxbin),
206  FitHist->GetBinCenter(maxbin) + 4 * FitHist->GetBinWidth(maxbin));
207  peakFit.SetParameters(750, 4, -.05);
208  FitHist->Fit(&peakFit, "RQI");
209  Float_t max = peakFit.Eval(-peakFit.GetParameter(1) / (2 * peakFit.GetParameter(2)));
210  if (ped != max) {
211  PN_amp[j] = PN_amp[j] + max - ped;
212  } else {
213  PN_amp[j] = PN_amp[j] + max;
214  }
215 
216  } //end of z loop
217  PN_amp[j] = PN_amp[j] / 2.0;
218  } //end of j loop
219 
220  //do some real PN, APD calculations
221 
222  //FIXME. previously used .info files to get time, what to do now?
223 
224  // TNtuple *Time = new TNtuple("Time", "Time", "Time");
225  // Int_t iTime = Get_Time(Input_File);
226  // Time->Fill(iTime);
227 
228  Float_t fTree[7];
229 
230  // b->GetEntry(EVT);
231  EBDetId ID;
232  Float_t theAPD;
233  Float_t thePN;
234  Float_t Jitter;
235  Float_t Chi2;
236  Int_t CN = hits->size();
237  // cout<<"num CN: "<<CN<<endl;
238  for (int j = 0; j < CN; j++) {
239  ID = (*hits)[j].id();
240  theAPD = (*hits)[j].amplitude();
241  Jitter = (*hits)[j].jitter();
242  Chi2 = (*hits)[j].chi2();
243  thePN = PN_amp[(ID.ic() + 299) / 400];
244 
245  // cout<<"THE APD: "<<theAPD<<endl;
246  // cout<<"THE PN: "<<thePN<<endl;
247 
248  C_APD[ID.ic() - 1]->Fill(theAPD);
249  C_APDPN[ID.ic() - 1]->Fill(theAPD / thePN);
250  C_PN[ID.ic() - 1]->Fill(thePN);
251  C_J[ID.ic() - 1]->Fill(Jitter);
252  C_APDPN_J[ID.ic() - 1]->Fill(Jitter, theAPD / thePN);
253  APDPN_J->Fill(Jitter, theAPD / thePN);
254  APDPN_C->Fill(Chi2, theAPD / thePN);
255  fTree[0] = theAPD;
256  fTree[1] = thePN;
257  fTree[2] = theAPD / thePN;
258  fTree[3] = Jitter;
259  fTree[4] = Chi2;
260  fTree[5] = (*hits)[j].pedestal();
261  fTree[6] = iEvent.id().event();
262  C_Tree[ID.ic() - 1]->Fill(fTree);
263  if (((ID.ic() - 1) % 20 > 9) || ((ID.ic() - 1) < 100)) {
264  peakAPD[0]->Fill(theAPD);
265  peakAPDPN[0]->Fill(theAPD / thePN);
266  APDPN_J_H[0]->Fill(Jitter, theAPD / thePN);
267  } else {
268  peakAPD[1]->Fill(theAPD);
269  peakAPDPN[1]->Fill(theAPD / thePN);
270  APDPN_J_H[1]->Fill(Jitter, theAPD / thePN);
271  }
272  if ((ID.ic() - 1) < 100) {
273  APD_LM[0]->Fill(theAPD);
274  APDPN_LM[0]->Fill(theAPD / thePN);
275  APDPN_J_LM[0]->Fill(Jitter, theAPD / thePN);
276  } else {
277  Int_t index;
278  if (((ID.ic() - 1) % 20) < 10) {
279  index = ((ID.ic() - 101) / 400) * 2 + 1;
280  APD_LM[index]->Fill(theAPD);
281  APDPN_LM[index]->Fill(theAPD / thePN);
282  APDPN_J_LM[index]->Fill(Jitter, theAPD / thePN);
283  } else {
284  index = ((ID.ic() - 101) / 400) * 2 + 2;
285  APD_LM[index]->Fill(theAPD);
286  APDPN_LM[index]->Fill(theAPD / thePN);
287  APDPN_J_LM[index]->Fill(Jitter, theAPD / thePN);
288  }
289  }
290  } //end of CN loop
291 
292  //now that you got the PN and APD's, make the ntuples. done
293 
294  //vec from ROOT version should correspond to hits_itr or something similar. done
295 
296  //check WL from PNdiodedigi, should be ==0, o.w (blue data only). don't process. done
297 
298  //get PN pulse, and do fitting of pulse. i.e. fill hist with PN.apd() or equivalent. done
299 
300  //fit to first 5 for PED, and 30-50 bins for pulse (poly2 for the moment). done
301 }
EventNumber_t event() const
Definition: EventID.h:40
uint32_t ID
Definition: Definitions.h:24
Log< level::Error, false > LogError
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
static const float CN[]
Definition: sicif.h:75
edm::EventID id() const
Definition: EventBase.h:59
Definition: Chi2.h:15
uint16_t *__restrict__ uint16_t const *__restrict__ adc
void EcalLaserAnalyzerYousi::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 304 of file EcalLaserAnalyzerYousi.cc.

References APD, APD_LM, APD_RMS, APDPN, APDPN_C, APDPN_J, APDPN_J_H, APDPN_J_LM, APDPN_LM, APDPN_RMS, C_APD, C_APDPN, C_APDPN_J, C_J, C_PN, C_Tree, Count, FitHist, fROOT, mps_fire::i, mergeVDriftHistosByStation::name, outFileName_, peakAPD, peakAPDPN, and PN.

304  {
305  edm::LogInfo("EcalLaserAnalyzerYousi") << "running laser analyzer \n\n";
306 
307  fROOT = new TFile(outFileName_.c_str(), "RECREATE");
308  fROOT->cd();
309 
310  //init all the histos and files?
311  APD = new TH2F("APD", "APD", 85, 0., 85., 20, 0., 20.);
312  APD_RMS = new TH2F("APD_RMS", "APD_RMS", 85, 0., 85., 20, 0., 20.);
313  APDPN = new TH2F("APDPN", "APDPN", 85, 0., 85., 20, 0., 20.);
314  APDPN_RMS = new TH2F("APDPN_RMS", "APDPN_RMS", 85, 0., 85., 20, 0., 20.);
315  PN = new TH2F("PN", "PN", 85, 0., 85., 20, 0., 20.);
316  APDPN_J = new TH2F("JittervAPDPN", "JittervAPDPN", 250, 3., 7., 250, 1., 2.);
317  APDPN_C = new TH2F("Chi2vAPDPN", "Chi2vAPDPN", 250, 0., 50., 250, 0., 5.0);
318  FitHist = new TH1F("FitHist", "FitHist", 50, 0, 50);
319  Count = new TH2F("Count", "Count", 85, 0., 1., 20, 0., 1.);
320 
321  for (int i = 0; i < 1700; i++) {
322  std::ostringstream name_1;
323  std::ostringstream name_2;
324  std::ostringstream name_3;
325  std::ostringstream name_4;
326  std::ostringstream name_5;
327  name_1 << "C_APD_" << i + 1;
328  name_2 << "C_APDPN_" << i + 1;
329  name_3 << "C_PN_" << i + 1;
330  name_4 << "C_J_" << i + 1;
331  name_5 << "C_APDPN_J_" << i + 1;
332  C_APD[i] = new TH1F(name_1.str().c_str(), name_1.str().c_str(), 2500, 0., 5000.);
333  C_APDPN[i] = new TH1F(name_2.str().c_str(), name_2.str().c_str(), 20000, 0., 25.);
334  C_PN[i] = new TH1F(name_3.str().c_str(), name_3.str().c_str(), 1000, 0., 4000.);
335  C_J[i] = new TH1F(name_4.str().c_str(), name_4.str().c_str(), 250, 3.0, 7.);
336  C_APDPN_J[i] = new TH2F(name_5.str().c_str(), name_5.str().c_str(), 250, 3.0, 6., 250, 1., 2.2);
337  }
338 
339  for (int i = 0; i < 2; i++) {
340  std::ostringstream aname_1;
341  std::ostringstream aname_2;
342  std::ostringstream aname_3;
343  aname_1 << "peakAPD_" << i;
344  aname_2 << "peakAPDPN_" << i;
345  aname_3 << "JittervAPDPN_Half_" << i;
346  peakAPD[i] = new TH1F(aname_1.str().c_str(), aname_1.str().c_str(), 1000, 0., 5000.);
347  peakAPDPN[i] = new TH1F(aname_2.str().c_str(), aname_2.str().c_str(), 1000, 0., 8.);
348  APDPN_J_H[i] = new TH2F(aname_3.str().c_str(), aname_3.str().c_str(), 250, 3., 7., 250, 1., 2.2);
349  }
350 
351  for (int i = 0; i < 9; i++) {
352  std::ostringstream bname_1;
353  std::ostringstream bname_2;
354  std::ostringstream bname_3;
355  bname_1 << "APD_LM_" << i;
356  bname_2 << "APDPN_LM_" << i;
357  bname_3 << "APDPN_J_LM_" << i;
358  APD_LM[i] = new TH1F(bname_1.str().c_str(), bname_1.str().c_str(), 500, 0., 5000.);
359  APDPN_LM[i] = new TH1F(bname_2.str().c_str(), bname_2.str().c_str(), 500, 0., 8.);
360  APDPN_J_LM[i] = new TH2F(bname_3.str().c_str(), bname_3.str().c_str(), 250, 3., 7., 250, 1., 2.2);
361  }
362 
363  //get the PN file. or don't get, and read from event.
364 
365  //don't need to get AB, it will be read in via framework poolsource = ???
366 
367  //configure the final NTuple
368  std::ostringstream varlist;
369  varlist << "APD:PN:APDPN:Jitter:Chi2:ped:EVT";
370  for (int i = 0; i < 1700; i++) {
371  std::ostringstream name;
372  name << "C_Tree_" << i + 1;
373  C_Tree[i] = (TNtuple *)new TNtuple(name.str().c_str(), name.str().c_str(), varlist.str().c_str());
374  }
375 }
Log< level::Info, false > LogInfo
void EcalLaserAnalyzerYousi::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 378 of file EcalLaserAnalyzerYousi.cc.

References APD, APD_LM, APD_RMS, APDPN, APDPN_C, APDPN_J, APDPN_J_H, APDPN_J_LM, APDPN_LM, APDPN_RMS, C_APD, C_APDPN, C_APDPN_J, C_J, C_PN, C_Tree, dqmPostProcessing_online::DIR, fROOT, mps_fire::i, dqmiolumiharvest::j, outFileName_, peakAPD, peakAPDPN, PN, RMS, and Run_.

Referenced by o2olib.O2ORunMgr::executeJob().

378  {
379  //write the file (get ouput file name first).
380  TFile *fROOT = (TFile *)new TFile(outFileName_.c_str(), "RECREATE");
381 
382  // TDirectory *DIR = fROOT->Get(Run_.c_str());
383  TDirectory *DIR;
384  // if(DIR == NULL){
385  DIR = fROOT->mkdir(Run_.c_str());
386  // }
387  DIR->cd();
388  for (int j = 0; j < 1700; j++) {
389  Float_t min_r, max_r;
390  Float_t RMS, Sigma, K;
391  Int_t iCount;
392  TF1 *gs3;
393 
394  RMS = C_APD[j]->GetRMS();
395  APD_RMS->SetBinContent(85 - (j / 20), 20 - (j % 20), RMS);
396  Sigma = 999999;
397  K = 2.5;
398  iCount = 0;
399  while (Sigma > RMS) {
400  min_r = C_APD[j]->GetBinCenter(C_APD[j]->GetMaximumBin()) - K * RMS;
401  max_r = C_APD[j]->GetBinCenter(C_APD[j]->GetMaximumBin()) + K * RMS;
402  TF1 gs1("gs1", "gaus", min_r, max_r);
403  C_APD[j]->Fit(&gs1, "RQI");
404  Sigma = gs1.GetParameter(2);
405  K = K * 1.5;
406  iCount++;
407  if (iCount > 2) {
408  C_APD[j]->Fit("gaus", "QI");
409  break;
410  }
411  }
412 
413  RMS = C_APDPN[j]->GetRMS();
414  APDPN_RMS->SetBinContent(85 - (j / 20), 20 - (j % 20), RMS);
415  Sigma = 999999;
416  K = 2.5;
417  iCount = 0;
418  while (Sigma > RMS) {
419  min_r = C_APDPN[j]->GetBinCenter(C_APDPN[j]->GetMaximumBin()) - K * RMS;
420  max_r = C_APDPN[j]->GetBinCenter(C_APDPN[j]->GetMaximumBin()) + K * RMS;
421  TF1 gs2("gs2", "gaus", min_r, max_r);
422  C_APDPN[j]->Fit(&gs2, "RQI");
423  Sigma = gs2.GetParameter(2);
424  K = K * 1.5;
425  iCount++;
426  if (iCount > 2) {
427  C_APDPN[j]->Fit("gaus", "QI");
428  break;
429  }
430  }
431 
432  TF1 *newgs1;
433  TF1 *newgs2;
434 
435  C_PN[j]->Fit("gaus", "Q");
436  C_APD[j]->Fit("gaus", "QI");
437  C_APDPN[j]->Fit("gaus", "QI");
438  C_APD[j]->Write("", TObject::kOverwrite);
439  C_APDPN[j]->Write("", TObject::kOverwrite);
440  C_PN[j]->Write("", TObject::kOverwrite);
441  C_J[j]->Write("", TObject::kOverwrite);
442  C_APDPN_J[j]->Write("", TObject::kOverwrite);
443  newgs1 = C_APD[j]->GetFunction("gaus");
444  newgs2 = C_APDPN[j]->GetFunction("gaus");
445  gs3 = C_PN[j]->GetFunction("gaus");
446  Float_t theAPD = newgs1->GetParameter(1);
447  APD->SetBinContent(85 - (j / 20), 20 - (j % 20), theAPD);
448  Float_t theAPDPN = newgs2->GetParameter(1);
449  APDPN->SetBinContent(85 - (j / 20), 20 - (j % 20), theAPDPN);
450  Float_t thePN = gs3->GetParameter(1);
451  // cout<<"LOOK HERE thePN = "<< thePN<<endl;
452  PN->SetBinContent(85 - (j / 20), 20 - (j % 20), thePN);
453  C_Tree[j]->Write("", TObject::kOverwrite);
454  }
455 
456  for (int i = 0; i < 9; i++) {
457  APD_LM[i]->Write("", TObject::kOverwrite);
458  APDPN_LM[i]->Write("", TObject::kOverwrite);
459  APDPN_J_LM[i]->Write("", TObject::kOverwrite);
460  }
461 
462  // Time->Write("", TObject::kOverwrite);
463  APD->Write("", TObject::kOverwrite);
464  APD_RMS->Write("", TObject::kOverwrite);
465  APDPN_RMS->Write("", TObject::kOverwrite);
466  APDPN->Write("", TObject::kOverwrite);
467  APDPN_J->Write("", TObject::kOverwrite);
468  APDPN_C->Write("", TObject::kOverwrite);
469  PN->Write("", TObject::kOverwrite);
470  peakAPD[0]->Write("", TObject::kOverwrite);
471  peakAPD[1]->Write("", TObject::kOverwrite);
472  peakAPDPN[0]->Write("", TObject::kOverwrite);
473  peakAPDPN[1]->Write("", TObject::kOverwrite);
474  APDPN_J_H[0]->Write("", TObject::kOverwrite);
475  APDPN_J_H[1]->Write("", TObject::kOverwrite);
476 
477  // don't Make plots
478  // fROOT->Close();
479 
480  // fPN->Close();
481  // fAPD->Close();
482 
483  fROOT->Write();
484  // fROOT->Close();
485 }

Member Data Documentation

TH2F* EcalLaserAnalyzerYousi::APD
private

Definition at line 78 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::APD_LM[9]
private

Definition at line 72 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APD_RMS
private

Definition at line 79 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN
private

Definition at line 80 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN_C
private

Definition at line 84 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN_J
private

Definition at line 83 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN_J_H[2]
private

Definition at line 75 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN_J_LM[9]
private

Definition at line 74 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::APDPN_LM[9]
private

Definition at line 73 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::APDPN_RMS
private

Definition at line 81 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::C_APD[1700]
private

Definition at line 64 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::C_APDPN[1700]
private

Definition at line 65 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::C_APDPN_J[1700]
private

Definition at line 68 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::C_J[1700]
private

Definition at line 67 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::C_PN[1700]
private

Definition at line 66 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TNtuple* EcalLaserAnalyzerYousi::C_Tree[1700]
private

Definition at line 93 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::Count
private

Definition at line 87 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob().

std::string EcalLaserAnalyzerYousi::digiProducer_
private

Definition at line 104 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), and EcalLaserAnalyzerYousi().

TFile* EcalLaserAnalyzerYousi::fAPD
private

Definition at line 90 of file EcalLaserAnalyzerYousi.cc.

TH1F* EcalLaserAnalyzerYousi::FitHist
private

Definition at line 86 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), and beginJob().

TFile* EcalLaserAnalyzerYousi::fPN
private

Definition at line 89 of file EcalLaserAnalyzerYousi.cc.

TFile* EcalLaserAnalyzerYousi::fROOT
private

Definition at line 91 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

std::string EcalLaserAnalyzerYousi::hitCollection_
private

Definition at line 97 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), and EcalLaserAnalyzerYousi().

std::string EcalLaserAnalyzerYousi::hitProducer_
private

Definition at line 98 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), and EcalLaserAnalyzerYousi().

std::string EcalLaserAnalyzerYousi::outFileName_
private

Definition at line 101 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), EcalLaserAnalyzerYousi(), and endJob().

TH1F* EcalLaserAnalyzerYousi::peakAPD[2]
private

Definition at line 70 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* EcalLaserAnalyzerYousi::peakAPDPN[2]
private

Definition at line 71 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), beginJob(), and endJob().

TH2F* EcalLaserAnalyzerYousi::PN
private

Definition at line 82 of file EcalLaserAnalyzerYousi.cc.

Referenced by beginJob(), and endJob().

std::string EcalLaserAnalyzerYousi::PNdigiCollection_
private

Definition at line 105 of file EcalLaserAnalyzerYousi.cc.

Referenced by analyze(), and EcalLaserAnalyzerYousi().

std::string EcalLaserAnalyzerYousi::Run_
private

Definition at line 103 of file EcalLaserAnalyzerYousi.cc.

Referenced by EcalLaserAnalyzerYousi(), and endJob().

std::string EcalLaserAnalyzerYousi::SM_
private

Definition at line 102 of file EcalLaserAnalyzerYousi.cc.

Referenced by EcalLaserAnalyzerYousi().