Classes | Namespaces | Functions
Calibration_module.cc File Reference
#include <iostream>
#include "art/Framework/Core/EDAnalyzer.h"
#include "canvas/Persistency/Common/FindOneP.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "art/Framework/Services/Optional/TFileService.h"
#include <TH2I.h>
#include <TProfile.h>
#include <TMath.h>
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "DDTBaseDataProducts/BaseProducts.h"
#include "DDTBaseDataProducts/HitList.h"
#include "DDTBaseDataProducts/DAQHit.h"
#include "DDTBaseDataProducts/Track3D.h"
#include "DDTBaseDataProducts/HitSet.h"
#include "OnlineCalibration/ChannelMapService.h"

Go to the source code of this file.

Classes

class  novaddt::Calibration
 

Namespaces

 novaddt
 

Functions

double FindW (const novaddt::Track3D &t, const novaddt::DAQHit &h)
 
double FindE (const novaddt::Track3D &t, const novaddt::DAQHit &h)
 

Function Documentation

double FindE ( const novaddt::Track3D t,
const novaddt::DAQHit h 
)

Definition at line 90 of file Calibration_module.cc.

References novaddt::DAQHit::ADC(), dir, novaddt::Track3D::End(), ana::Sqrt(), novaddt::Track3D::Start(), Unit(), novaddt::ADC::val, novaddt::View::val, and novaddt::DAQHit::View().

Referenced by novaddt::Calibration::analyze().

90  {
91  TVector3 dir=(t.End()-t.Start()).Unit();
92  //geometric factor = sin(angle between dir and cell orientation)
93  double Factor=1;
94  if(h.View().val==1)Factor=TMath::Sqrt(1-dir.X()*dir.X());
95  if(h.View().val==2)Factor=TMath::Sqrt(1-dir.Y()*dir.Y());
96  return h.ADC().val*Factor;
97 }
TVector3 const & End() const
Definition: Track3D.h:46
novaddt::ADC const & ADC() const
Definition: DAQHit.h:73
novaddt::View const & View() const
Definition: DAQHit.h:72
TVector3 const & Start() const
Definition: Track3D.h:45
TVector3 Unit() const
TDirectory * dir
Definition: macro.C:5
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
value_type val
Definition: BaseProducts.h:137
value_type val
Definition: BaseProducts.h:65
double FindW ( const novaddt::Track3D t,
const novaddt::DAQHit h 
)

Definition at line 78 of file Calibration_module.cc.

References dir, novaddt::Track3D::End(), novaddt::DAQHit::Plane(), elec2geo::pos, novaddt::Track3D::Start(), novaddt::Plane::val, novaddt::View::val, and novaddt::DAQHit::View().

Referenced by novaddt::Calibration::analyze().

78  {
79  TVector3 dir=(t.End()-t.Start());
80  dir*=1./dir.Z();
81  TVector3 pos=t.Start()+dir*(h.Plane().val-t.Start().Z());
82 /* std::cout<<"Z: "<<t.Start().Z()<<" - "<<t.End().Z()
83  <<"pos["<<h.Plane().val<<"] = "
84  <<pos.X()<<", "<<pos.Y()<<", "<<pos.Z()
85  <<std::endl;*/
86  if(h.View().val==1)return pos.Y();
87  if(h.View().val==2)return pos.X();
88  return -999;
89 }
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
TVector3 const & End() const
Definition: Track3D.h:46
novaddt::View const & View() const
Definition: DAQHit.h:72
TVector3 const & Start() const
Definition: Track3D.h:45
value_type val
Definition: BaseProducts.h:84
TDirectory * dir
Definition: macro.C:5
value_type val
Definition: BaseProducts.h:137