Logo coherent WaveBurst  
Library Reference Guide
Logo
AddChip.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Francesco Salemi
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 void AddChip(TString filein,TString treename) {
20  CWB::CBCTool cbcTool;
21  TFile *f = new TFile(filein,"update");
22  TTree *T = (TTree*)f->Get(treename);
23  float mass[2];
24  float spin[6];
25  float chip;
26  TBranch *bchip = T->Branch("chip",&chip,"chip/F");
27  T->SetBranchAddress("mass", mass);
28  T->SetBranchAddress("spin", spin);
29  Long64_t nentries = T->GetEntries();
30  for (Long64_t i=0;i<nentries;i++) {
31  T->GetEntry(i);
32  chip = cbcTool.chip(mass[0], mass[1], spin[0], spin[1], spin[2], spin[3], spin[4], spin[5]);
33  //cout << mass[0] << " " << mass[1] << " " << spin[0] << " " << spin[1] << " " << spin[2] << " " << spin[3] << " " << spin[4] << " " <<spin[5] << endl;
34  bchip->Fill();
35  }
36  T->Print();
37  T->Write();
38  delete f;
39 }
Int_t nentries
Definition: TimeSortTree.C:24
void AddChip(TString filein, TString treename)
Definition: AddChip.C:19
TString("c")
i drho i
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
static double chip(double m1, double m2, double s1x, double s1y, double s1z, double s2x, double s2y, double s2z)
Definition: CBCTool.cc:1084
float spin[6]
double T
Definition: testWDM_4.C:11
float mass[2]