Changes in classes/DelphesLHEFReader.cc [1e8afcc:cab38f6] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
classes/DelphesLHEFReader.cc
r1e8afcc rcab38f6 82 82 fEventCounter = -1; 83 83 fParticleCounter = -1; 84 f WeightList.clear();84 fRwgtList.clear(); 85 85 } 86 86 … … 99 99 TObjArray *partonOutputArray) 100 100 { 101 int rc , id;101 int rc; 102 102 char *pch; 103 103 double weight; … … 158 158 else if(strstr(fBuffer, "<wgt")) 159 159 { 160 pch = str pbrk(fBuffer, "\"'");160 pch = strstr(fBuffer, ">"); 161 161 if(!pch) 162 162 { … … 165 165 } 166 166 167 DelphesStream idStream(pch + 1); 168 rc = idStream.ReadInt(id); 169 170 pch = strchr(fBuffer, '>'); 171 if(!pch) 167 DelphesStream bufferStream(pch + 1); 168 rc = bufferStream.ReadDbl(weight); 169 170 if(!rc) 172 171 { 173 172 cerr << "** ERROR: " << "invalid weight format" << endl; … … 175 174 } 176 175 177 DelphesStream weightStream(pch + 1); 178 rc = weightStream.ReadDbl(weight); 179 180 if(!rc) 181 { 182 cerr << "** ERROR: " << "invalid weight format" << endl; 183 return kFALSE; 184 } 185 186 fWeightList.push_back(make_pair(id, weight)); 176 fRwgtList.push_back(weight); 187 177 } 188 178 else if(strstr(fBuffer, "</event>")) … … 216 206 //--------------------------------------------------------------------------- 217 207 218 void DelphesLHEFReader::AnalyzeWeight(ExRootTreeBranch *branch) 219 { 220 LHEFWeight *element; 221 vector< pair< int, double > >::const_iterator itWeightList; 222 223 for(itWeightList = fWeightList.begin(); itWeightList != fWeightList.end(); ++itWeightList) 224 { 225 element = static_cast<LHEFWeight *>(branch->NewEntry()); 226 227 element->ID = itWeightList->first; 228 element->Weight = itWeightList->second; 208 void DelphesLHEFReader::AnalyzeRwgt(ExRootTreeBranch *branch) 209 { 210 Weight *element; 211 vector<double>::const_iterator itRwgtList; 212 213 for(itRwgtList = fRwgtList.begin(); itRwgtList != fRwgtList.end(); ++itRwgtList) 214 { 215 element = static_cast<Weight *>(branch->NewEntry()); 216 217 element->Weight = *itRwgtList; 229 218 } 230 219 }
Note:
See TracChangeset
for help on using the changeset viewer.