HEP_practiceV2.C (6.7 KB)
Hi, so I went ahead and made changes of the variables so that they are now arrays in stead of simple int/float variables. I also removed indices for nLeps35 since it is not an array variable. However, I get these error: no matching member function for call to 'Fill'
errors. Should I try to convert the arrays from float to double as the error suggests or approach this differently?
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:98:6: error: no matching member function for call to 'SetBranchAddress'
t1->SetBranchAddress("nLeps35",nLeps35);
~~~~^~~~~~~~~~~~~~~~
/home/nick/root/include/TTree.h:578:28: note: candidate function not viable: no known conversion from 'int' to 'void *' for 2nd argument; take the address of the argument with &
virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr = 0);
^
/home/nick/root/include/TTree.h:581:29: note: candidate template ignored: could not match 'T **' against 'int'
template <class T> Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr = 0) {
^
/home/nick/root/include/TTree.h:590:29: note: candidate template ignored: could not match 'T *' against 'int'
template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = 0) {
^
/home/nick/root/include/TTree.h:579:28: note: candidate function not viable: requires 5 arguments, but 2 were provided
virtual Int_t SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, Bool_t isptr);
^
/home/nick/root/include/TTree.h:580:28: note: candidate function not viable: requires 6 arguments, but 2 were provided
virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, Bool_t isptr);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:112:17: error: no matching member function for call to 'Fill'
histpTLep->Fill(pTLep);
~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:113:18: error: no matching member function for call to 'Fill'
histetaLep->Fill(etaLep);
~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:114:18: error: no matching member function for call to 'Fill'
histphiLep->Fill(phiLep);
~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:116:20: error: no matching member function for call to 'Fill'
histpTLepPos->Fill(pTLep);
~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:117:21: error: no matching member function for call to 'Fill'
histetaLepPos->Fill(etaLep);
~~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:118:21: error: no matching member function for call to 'Fill'
histphiLepPos->Fill(phiLep);
~~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:122:17: error: no matching member function for call to 'Fill'
histpTLep->Fill(pTLep);
~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:123:18: error: no matching member function for call to 'Fill'
histetaLep->Fill(etaLep);
~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:124:18: error: no matching member function for call to 'Fill'
histphiLep->Fill(phiLep);
~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:126:20: error: no matching member function for call to 'Fill'
histpTLepNeg->Fill(pTLep);
~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:127:21: error: no matching member function for call to 'Fill'
histetaLepNeg->Fill(etaLep);
~~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);
^
In file included from input_line_13:1:
/home/nick/PHY496/mhance/HEP_practiceV2.C:128:21: error: no matching member function for call to 'Fill'
histphiLepNeg->Fill(phiLep);
~~~~~~~~~~~~~~~^~~~
/home/nick/root/include/TH1.h:215:21: note: candidate function not viable: no known conversion from 'float [3]' to 'Double_t' (aka 'double') for 1st argument
virtual Int_t Fill(Double_t x);
^
/home/nick/root/include/TH1.h:216:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(Double_t x, Double_t w);
^
/home/nick/root/include/TH1.h:217:21: note: candidate function not viable: requires 2 arguments, but 1 was provided
virtual Int_t Fill(const char *name, Double_t w);