FEDRA emulsion software from the OPERA Collaboration
distor.C File Reference

Functions

void addarrow (TCanvas *c, Float_t x, Float_t y, Float_t dx, Float_t dy, int color)
 
 distor (char *fnam)
 

Function Documentation

◆ addarrow()

void addarrow ( TCanvas c,
Float_t  x,
Float_t  y,
Float_t  dx,
Float_t  dy,
int  color 
)
49{
50 c->cd();
51 Float_t ascale=1.; // full scale in radians
52 Float_t cscale=24000.; // full scale in microns
53 x+=12000.;
54 y+=12000.;
55 x/=cscale;
56 y/=cscale;
57 TArrow *a=new TArrow(x,y,x+dx/ascale,y+dy/ascale,0.002);
58 a->SetLineColor(color);
59 a->Draw();
60}
void a()
Definition: check_aligned.C:59

◆ distor()

distor ( char *  fnam)
2{
3 TH2F* h1=new TH2F("h1","h1",100,-.1,.1,100,-.1,.1);
4 ctop=new TCanvas();
5// cbot=new TCanvas();
6 TFile *f = TFile::Open(fnam);
7 tree=(TTree*)f->Get("couples");
8
9 int nentr = int(tree->GetEntries());
10
11 float xoff = -61000.;
12 float yoff = 58000.;
13
14 EdbSegP *s2 = 0,*s=0,*s1=0;
15 EdbSegCouple *cp = 0;
16 TClonesArray *as = 0;
17 TClonesArray *as1 = 0;
18 TClonesArray *as2 = 0;
19 Int_t nseg;
20 Float_t dx_top,dy_top,dx_bot,dy_bot;
21 tree->SetBranchAddress("s." , &s );
22 tree->SetBranchAddress("s1." , &s1 );
23 tree->SetBranchAddress("s2." , &s2 );
24 tree->SetBranchAddress("cp" , &cp );
25 for(int i=0;i<nentr;i++)
26 {
27 tree->GetEntry(i);
28 if(fabs(s->TY())<.1 && fabs(s->TX())<.1)
29 if(cp->N1()==1)
30 if(cp->N2()==1)
31 if(cp->CHI2P()<1.5)
32 {
33 dx_top=s->TX()-s1->TX();
34 dx_bot=s->TX()-s2->TX();
35 dy_top=s->TY()-s1->TY();
36 dy_bot=s->TY()-s2->TY();
37 addarrow(ctop,s->X()-xoff,s->Y()-yoff,dx_top,dy_top,kRed);
38 addarrow(ctop,s->X()-xoff,s->Y()-yoff,dx_bot,dy_bot,kBlue);
39 // addarrow(ctop,s->X(),s->Y(),dx_bot-dx_top,dy_bot-dy_top,kBlue);
40// h1->Fill(dx_top,dx_bot);
41 }
42 addarrow(ctop,-11600.,-11600.,.1,0.,kBlack);
43// h1->Draw();
44 }
45
46}
FILE * f
Definition: RecDispMC.C:150
Expr< UnaryOp< Fabs< T >, Expr< A, T, D >, T >, T, D > fabs(const Expr< A, T, D > &rhs)
Definition: UnaryOperators.hh:96
Definition: EdbSegCouple.h:17
float CHI2P() const
Definition: EdbSegCouple.h:62
int N1() const
Definition: EdbSegCouple.h:57
int N2() const
Definition: EdbSegCouple.h:58
Definition: EdbSegP.h:21
Float_t TX() const
tangens = deltaX/deltaZ
Definition: EdbSegP.h:175
Float_t TY() const
tangens = deltaY/deltaZ
Definition: EdbSegP.h:176
s
Definition: check_shower.C:55
void addarrow(TCanvas *c, Float_t x, Float_t y, Float_t dx, Float_t dy, int color)
Definition: distor.C:48
TH1F * h1
Definition: energy.C:16
EdbSegP * s1
Definition: tlg2couples.C:29
EdbSegP * s2
Definition: tlg2couples.C:30
EdbSegCouple * cp
Definition: tlg2couples.C:28
new TCanvas()