clas12root
Loading...
Searching...
No Matches
region_fdet.h
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: region_fdet.h
9 * Author: dglazier
10 *
11 * Created on April 27, 2017, 10:01 AM
12 */
13
14#ifndef REGION_FDET_H
15#define REGION_FDET_H
16
17#include "clas12defs.h"
18#include "region_particle.h"
19
20namespace clas12 {
21
22
24
25
26 public:
27
28 // region_fdet()=default;
30 cal_ptr calp, scint_ptr scp, trck_ptr trp, utrck_ptr utrp,
32 rich_ptr rich,mcpar_ptr mcp=nullptr);
33 ~region_fdet() override =default;
34
35
36 bool sort() final;
37
38 cal_ptr cal(ushort lay) const final;
39 scint_ptr sci(ushort lay) const final;
40 traj_ptr traj(ushort det,ushort layer=0) const final;
41 trck_ptr trk(ushort lay) const final
42 {
43 _trck->setIndex(_ptrck);return _trck;
44 }
45 utrck_ptr utrk(ushort lay) const final
46 {
47 _utrck->setIndex(_ptrck);return _utrck;
48 }
49 cher_ptr che(ushort lay) const final;
50 rich_ptr rich() const final;
51
52
53 double getTime() const final{
54 if(_ptof>-1 && par()->getCharge()!=0){
55 _scint->setIndex(_ptof);
56 return _scint->getTime();
57 }
58 _cal->setIndex(_pcal);
59 return _cal->getTime();
60 }
61 double getPath() const final{
62 if(_ptof>-1 && par()->getCharge()!=0){
63 _scint->setIndex(_ptof);
64 return _scint->getPath();
65 }
66 _cal->setIndex(_pcal);
67 return _cal->getPath();
68 }
69
70 double getDetEnergy() const final{
71 _cal->setIndex(_ppre);
72 double energy=_cal->getEnergy();
73 _cal->setIndex(_pin);
74 energy+=_cal->getEnergy();
75 _cal->setIndex(_pout);
76 energy+=_cal->getEnergy();
77 return energy;
78 }
79
80 double getDeltaEnergy() const final{
81 _scint->setIndex(_ptof);
82 return _scint->getEnergy();
83 }
84
85 short getSector() const final{
86 if(_ptrck>-1){
87 _trck->setIndex(_ptrck);
88 return _trck->getSector();
89 }
90 if(_ptof>-1){
91 _scint->setIndex(_ptof);
92 return _scint->getSector();
93 }
94 _cal->setIndex(_pcal);
95 return _cal->getSector();
96 }
97
98 private:
99
100
101
102 //calorimeter indices
103 short _pcal=-1;
104 short _ppre=-1;
105 short _pin=-1;
106 short _pout=-1;
107 //scintillator indices
108 short _ptof=-1;
109 short _ptof1=-1;
110 short _ptof2=-1;
111 short _ptof3=-1;
112 //track index
113 short _ptrck=-1;
114 //traj index
115 // short _ptraj=-1;
116 //cherenkov indices
117 short _phtcc=-1;
118 short _pltcc=-1;
119 short _prich=-1;
120
121
122
123 };
124
126 using region_fdet_uptr=std::unique_ptr<clas12::region_fdet>;
127
128}
129
130#endif /* REGION_FDET_H */
Definition region_fdet.h:23
region_fdet(par_ptr pars, ftbpar_ptr ftbpars, covmat_ptr cm, cal_ptr calp, scint_ptr scp, trck_ptr trp, utrck_ptr utrp, traj_ptr trj, cher_ptr chp, ft_ptr ftp, event_ptr event, rich_ptr rich, mcpar_ptr mcp=nullptr)
Definition region_fdet.cpp:14
cal_ptr cal(ushort lay) const final
Definition region_fdet.cpp:67
trck_ptr trk(ushort lay) const final
Definition region_fdet.h:41
double getPath() const final
Definition region_fdet.h:61
scint_ptr sci(ushort lay) const final
Definition region_fdet.cpp:84
rich_ptr rich() const final
Definition region_fdet.cpp:116
utrck_ptr utrk(ushort lay) const final
Definition region_fdet.h:45
double getDeltaEnergy() const final
Definition region_fdet.h:80
~region_fdet() override=default
cher_ptr che(ushort lay) const final
Definition region_fdet.cpp:101
double getDetEnergy() const final
Definition region_fdet.h:70
double getTime() const final
Definition region_fdet.h:53
short getSector() const final
Definition region_fdet.h:85
bool sort() final
Definition region_fdet.cpp:23
traj_ptr traj(ushort det, ushort layer=0) const final
Definition region_fdet.cpp:128
event_ptr event() const
Definition region_particle.h:109
cal_ptr _cal
Definition region_particle.h:190
utrck_ptr _utrck
Definition region_particle.h:193
scint_ptr _scint
Definition region_particle.h:191
trck_ptr _trck
Definition region_particle.h:192
const par_ptr par() const
Definition region_particle.h:110
Definition calextras.cpp:10
clas12::calorimeter * cal_ptr
Definition calorimeter.h:225
clas12::rich * rich_ptr
Definition rich.h:255
clas12::cherenkov * cher_ptr
Definition cherenkov.h:99
clas12::particle * par_ptr
Definition particle.h:118
clas12::ftbparticle * ftbpar_ptr
Definition ftbparticle.h:87
clas12::traj * traj_ptr
Definition traj.h:93
clas12::mcparticle * mcpar_ptr
Definition mcparticle.h:144
clas12::covmatrix * covmat_ptr
Definition covmatrix.h:87
clas12::utracker * utrck_ptr
Definition utracker.h:103
clas12::forwardtagger * ft_ptr
Definition forwardtagger.h:115
clas12::region_fdet * region_fdet_ptr
Definition region_fdet.h:125
clas12::event * event_ptr
Definition event.h:74
clas12::scintillator * scint_ptr
Definition scintillator.h:133
clas12::tracker * trck_ptr
Definition tracker.h:73
std::unique_ptr< clas12::region_fdet > region_fdet_uptr
Definition region_fdet.h:126