Skip to content
Snippets Groups Projects
Commit c2fadee6 authored by Vardan Tadevosyan's avatar Vardan Tadevosyan Committed by Stephen A. Wood
Browse files

Comment HMS calorimeter calibration code.

parent 95db9d09
No related branches found
No related tags found
No related merge requests found
#include <iostream>
// HMS calorimeter hit class for calibration.
class THcShHit {
Double_t ADCpos, ADCneg;
Double_t ADCpos, ADCneg; // pedestal subtracted ADC signals.
Double_t Epos, Eneg;
UInt_t BlkNumber;
......
......@@ -7,6 +7,10 @@
using namespace std;
// Track class for the HMS calorimeter calibration.
// Comprises the spectrometer track parameters and calorimeter hits.
//
// Container (collection) of hits and its iterator.
//
typedef vector<THcShHit*> THcShHitList;
......@@ -15,11 +19,11 @@ typedef THcShHitList::iterator THcShHitIt;
class THcShTrack {
UInt_t Nhits;
Double_t P;
Double_t X;
Double_t Xp;
Double_t Y;
Double_t Yp;
Double_t P; // track momentum
Double_t X; // at the calorimater face
Double_t Xp; // slope
Double_t Y; // at the calorimater face
Double_t Yp; // slope
THcShHitList Hits;
......@@ -28,32 +32,45 @@ class THcShTrack {
THcShTrack(UInt_t nh, Double_t p,
Double_t x, Double_t xp, Double_t y, Double_t yp);
~THcShTrack();
void SetTrack(UInt_t nh, Double_t p,
Double_t x, Double_t xp, Double_t y, Double_t yp);
void AddHit(Double_t adc_pos, Double_t adc_neg,
Double_t e_pos, Double_t e_neg,
UInt_t blk_number);
THcShHit* GetHit(UInt_t k);
UInt_t GetNhits() {return Nhits;};
void Print();
Bool_t CheckHitNumber();
void SetEs(Double_t* alpha);
Double_t Enorm();
Double_t GetP() {return P*1000.;} //MeV
Float_t Ycor(Double_t);
Float_t Ycor(Double_t, Int_t);
Float_t Ycor(Double_t); // coord. corection for single PMT module
Float_t Ycor(Double_t, Int_t); // coord. correction for double PMT module
// Coordinate correction constants from hcana.param.
//
static const Double_t fAcor = 200.;
static const Double_t fBcor = 8000.;
static const Double_t fCcor = 64.36;
static const Double_t fDcor = 1.66;
static const Double_t fZbl = 10;
// Calorimeter geometry constants.
//
static const Double_t fZbl = 10; //cm, block transverse size
static const UInt_t fNrows = 13;
static const UInt_t fNcols = 4;
static const UInt_t fNnegs = 26;
static const UInt_t fNpmts = 78;
static const UInt_t fNnegs = 26; // number of blocks with neg. side PMTs.
static const UInt_t fNpmts = 78; // total number of PMTs.
static const UInt_t fNblks = fNrows*fNcols;
};
......@@ -107,6 +124,8 @@ void THcShTrack::Print() {
};
// Check hit number with the size of hit collection.
//
Bool_t THcShTrack::CheckHitNumber() {
return (Nhits == Hits.size());
};
......@@ -121,6 +140,9 @@ THcShTrack::~THcShTrack() {
//------------------------------------------------------------------------------
void THcShTrack::SetEs(Double_t* alpha) {
// Set hit energy depositions seen from postive and negative sides,
// by use of calibration (gain) constants alpha.
for (THcShHitIt iter = Hits.begin(); iter != Hits.end(); iter++) {
......@@ -148,6 +170,8 @@ void THcShTrack::SetEs(Double_t* alpha) {
Double_t THcShTrack::Enorm() {
// Normalized to track momentum energy depostion in the calorimeter.
Double_t sum = 0;
for (THcShHitIt iter = Hits.begin(); iter != Hits.end(); iter++) {
......
This diff is collapsed.
#include "TCanvas.h"
#include "THcShowerCalib.h"
//
// A steering Root script for the HMS calorimeter calibration.
//
void hcal_calib(Int_t RunNumber) {
cout << "Calibrating run " << RunNumber << endl;
THcShowerCalib theShowerCalib(RunNumber);
theShowerCalib.ExtractData();
theShowerCalib.Init();
theShowerCalib.CalcThresholds();
theShowerCalib.ComposeVMs();
theShowerCalib.SolveAlphas();
theShowerCalib.FillHEcal();
theShowerCalib.SaveAlphas();
theShowerCalib.ExtractData(); // Extract data from the Root file
theShowerCalib.Init(); // Initialize constants adn variables
theShowerCalib.CalcThresholds(); // Thresholds on the uncalibrated Edep/P
theShowerCalib.ComposeVMs(); // Compute vectors amd matrices for calib.
theShowerCalib.SolveAlphas(); // Solve for the calibration constants
theShowerCalib.FillHEcal(); // Fill histograms
theShowerCalib.SaveAlphas(); // Save the constants
// Plot histograms
TCanvas* Canvas =
new TCanvas("Canvas", "HMS Shower Counter calibration", 1000, 667);
......@@ -21,15 +27,21 @@ void hcal_calib(Int_t RunNumber) {
Canvas->cd(1);
// Normalized uncalibrated energy deposition.
theShowerCalib.hEunc->DrawCopy();
theShowerCalib.hEuncSel->SetFillColor(kGreen);
theShowerCalib.hEuncSel->DrawCopy("same");
// Normalized energy deposition after calibration.
Canvas->cd(3);
// theShowerCalib.hEcal->Draw();
theShowerCalib.hEcal->Fit("gaus");
// Momentum versus the calibrated energy deposition.
Canvas->cd(4);
theShowerCalib.hPvsEcal->Draw();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment