ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/Selection/src/applySelection.cc
(Generate patch)

Comparing UserCode/MitHzz4l/Selection/src/applySelection.cc (file contents):
Revision 1.8 by khahn, Fri Oct 14 11:20:25 2011 UTC vs.
Revision 1.14 by khahn, Sat May 5 21:43:55 2012 UTC

# Line 4 | Line 4
4   #include <vector>                   // STL vector class
5   #include <iostream>                 // standard I/O
6   #include <iomanip>                  // functions to format standard I/O
7 < #include <fstream>                  // functions for file I/O
8 < #include <string>                   // C++ string class
9 < #include <sstream>                  // class for parsing strings
10 < #include <assert.h>
11 < #include <stdlib.h>  
12 < #include <getopt.h>
7 > #include <bitset>  
8   using namespace std;
9  
10   //
11 < // ROOT headers
11 > // root headers
12   //
13 < #include <TROOT.h>                  // access to gROOT, entry point to ROOT system
14 < #include <TSystem.h>                // interface to OS
15 < #include <TFile.h>                  // file handle class
16 < #include <TNtuple.h>
17 < #include <TTree.h>                  // class to access ntuples
18 < #include <TChain.h>                 //
19 < #include <TBranch.h>                // class to access branches in TTree
20 < #include <TClonesArray.h>           // ROOT array class
21 < #include <TCanvas.h>                // class for drawing
22 < #include <TH1F.h>                   // 1D histograms
23 < #include <TBenchmark.h>             // class to track macro running statistics
24 < #include <TLorentzVector.h>         // 4-vector class
25 < #include <TVector3.h>               // 3D vector class
13 > #include <TFile.h>                  
14 > #include <TTree.h>                  
15 > #include <TChain.h>                
16 > #include <TBranch.h>                
17 > #include <TClonesArray.h>          
18 >
19 >
20 > //
21 > // TMVA
22 > //
23 > #include "TMVA/Reader.h"
24 > #include "TMVA/Tools.h"
25 > #include "TMVA/Config.h"
26 > #include "TMVA/MethodBDT.h"
27  
28   //
29   // ntuple format headers
30   //
31 < #include "HiggsAnaDefs.hh"
32 < #include "TEventInfo.hh"
33 < #include "TElectron.hh"
34 < #include "TMuon.hh"
35 < #include "TJet.hh"
36 < #include "SiMVAElectronSelection.h"
37 < #include "RunLumiRangeMap.h"
31 > #include "EventHeader.h"
32 > #include "Electron.h"
33 > #include "Muon.h"
34 > #include "Vertex.h"
35 > #include "PFCandidate.h"
36 > #include "PFCandidateCol.h"
37 > #include "TriggerMask.h"
38 > #include "TriggerTable.h"
39 > #include "Names.h"
40 > #include "BaseMod.h"
41  
42   //
43 < // utility headers
43 > // our headers
44   //
45   #include "ParseArgs.h"
46 + #include "MuonSelection.h"
47 + #include "ElectronSelection.h"
48 + #include "IsolationSelection.h"
49 +
50 + //#include "Selection.h"
51 + #include "ReferenceSelection.h"
52 +
53 + #include "TriggerUtils.h"
54 + #include "PassHLT.h"
55 + #include "Angles.h"
56 + #include "KinematicsStruct.h"
57 + #include "InfoStruct.h"
58 + //#include "GenInfoStruct.h"
59 + #include "WeightStruct.h"
60 + #include "GlobalDataAndFuncs.h"
61 + #include "AngleTuple.h"
62 +
63   #include "SampleWeight.h"
64 < #include "Selection.h"
65 < #include "HZZCiCElectronSelection.h"
66 < #include "HZZLikelihoodElectronSelection.h"
67 < #include "HZZBDTElectronSelection.h"
68 < #include "SampleWeight.h"
64 > #include "EfficiencyWeightsInterface.h"
65 >
66 > #ifndef CMSSW_BASE
67 > #define CMSSW_BASE "../"
68 > #endif
69  
70 < //#define BDTFAIL_THEIR_EVENTS
71 < //#define THEIR_EVENTS
70 > using namespace mithep;
71 >
72 >
73 > //----------------------------------------------------------------------------
74 > bool setPV(ControlFlags,const mithep::Array<mithep::Vertex>*, mithep::Vertex& );
75 > //----------------------------------------------------------------------------
76  
77   //=== MAIN =================================================================================================
78   int main(int argc, char** argv)
79   {
80 <  
80 >  string cmsswpath(CMSSW_BASE);
81 >  cmsswpath.append("/src");
82 >  std::bitset<1024> triggerBits;
83    vector<vector<string> > inputFiles;
84    inputFiles.push_back(vector<string>());
85 +  map<string,double> entrymap; // number of unskimmed entries in each file
86  
87    //
88    // args
89    //--------------------------------------------------------------------------------------------------------------
90    ControlFlags ctrl;
91    parse_args( argc, argv, ctrl );
92 <  if( ctrl.inputfile.empty() ||
93 <      ctrl.inputfile.empty() ) {
94 <    cerr << "usage: applySelection.exe <flags> " << endl;
95 <    cerr << "\tmandoatory flags : " << endl;
96 <    cerr << "\t--inputfile |  file containing a list of ntuples to run over" << endl;
97 <    cerr << "\t--outputfile | file to store  selected evet" << endl;
98 <    return 1;
99 <  }
92 >  if( ctrl.inputfiles.empty() &&ctrl.inputfile.empty() )
93 >    {
94 >      cerr << "usage: applySelection.exe <flags> " << endl;
95 >      cerr << "\tmandoatory flags : " << endl;
96 >      cerr << "\t--inputfiles |  file containing a list of ntuples to run over" << endl;
97 >      cerr << "\t--inputfile |  a file to run over" << endl;
98 >      cerr << "\t--outputfile | file to store  selected evet" << endl;
99 >      return 1;
100 >    }
101    ctrl.dump();
102 +  assert( ctrl.mH != 0 );
103 +
104  
79  map<string,double> entrymap; // number of unskimmed entries in each file
105  
106    //
107    // File I/O
108    //--------------------------------------------------------------------------------------------------------------
109    TChain * chain = new TChain("Events");
110 <  ifstream f(ctrl.inputfile.c_str());
110 >  TChain * hltchain = new TChain("HLT");
111 >
112    string fname;
113 <  while (f >> fname) {
114 <    if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines
115 <    cout << "adding inputfile : " << fname.c_str() << endl;
116 <    entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str());
117 <    chain->AddFile(fname.c_str());
113 >  if( !ctrl.inputfiles.empty() ) {
114 >    ifstream f(ctrl.inputfiles.c_str());
115 >    while (f >> fname) {
116 >      if( !(strncmp( fname.c_str(), "#", 1 ) ) ) continue; // skip commented lines
117 >      cout << "adding inputfile : " << fname.c_str() << endl;
118 >      entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str());
119 >      chain->AddFile(fname.c_str());
120 >      hltchain->AddFile(fname.c_str());
121 >    }
122 >  } else {
123 >    cout << "adding inputfile : " << ctrl.inputfile.c_str() << endl;
124 >    entrymap[string(ctrl.inputfile.c_str())] = unskimmedEntries(ctrl.inputfile.c_str());
125 >    chain->AddFile(ctrl.inputfile.c_str());
126 >    hltchain->AddFile(ctrl.inputfile.c_str());
127    }
128  
129 +  const char * ofname;
130 +  if( strcmp( ctrl.outputfile.c_str(), "") ) {
131 +    ofname = ctrl.outputfile.c_str();
132 +  } else {
133 +    ofname = "tmp.root";
134 +  }
135    // table of cross section values  
136 <  SimpleTable xstab("./data/xs.dat");
136 >  string xspath = (cmsswpath+string("/MitPhysics/data/xs.dat"));
137 >  cout << "xspath: " << xspath.c_str() << endl;
138 >  SimpleTable xstab(xspath.c_str());
139 >
140  
141    //
142    // Setup
143    //--------------------------------------------------------------------------------------------------------------
144 <  TH1F * h_evt = new TH1F("hevt", "hevt", 2, 0, 2 );
145 <  TH1F * h_evtfail = new TH1F("hevtfail", "hevtfail", 1024, 0, 1024 );
146 <  //  TNtuple * passtuple = new TNtuple( "passtuple", "passtuple", "run:evt:lumi:channel:mZ1:mZ2:m4l:pt4l:w" );
147 <  TTree * passtuple = new TTree("passtuple", "passtuple" );
148 <  unsigned run, evt, lumi, channel;
149 <  float mZ1, mZ2, m4l, pt4l;
150 <  double w;
151 <  passtuple->Branch("run", &run);
152 <  passtuple->Branch("evt", &evt);
153 <  passtuple->Branch("lumi", &lumi);
154 <  passtuple->Branch("mZ1", &mZ1);
155 <  passtuple->Branch("mZ2", &mZ2);
156 <  passtuple->Branch("m4l", &m4l);
157 <  passtuple->Branch("pt4l", &pt4l);
158 <  passtuple->Branch("w", &w);
159 <  initCiCSelection();
160 <  if(ctrl.eleSele=="lik") initLikSelection();
161 <  if(ctrl.eleSele=="bdt") initBDTSelection();
162 <  if(ctrl.eleSele=="si" ) initSiMVAElectronSelection();
163 <  initRunLumiRangeMap();
144 >  Angles angles;
145 >  KinematicsStruct kinematics;
146 >  InfoStruct evtinfo;
147 >  WeightStruct weights;
148 >  //  GenInfoStruct geninfo;
149 >
150 >  AngleTuple nt( (const char*)ofname, (const char*)"zznt");
151 >  nt.makeAngleBranch(angles);
152 >  nt.makeKinematicsBranch(kinematics);
153 >  nt.makeInfoBranch(evtinfo);
154 >
155 >  TH1F * h_w_hpt;
156 >  if(ctrl.mc) {
157 >    nt.makeWeightBranch(weights);
158 >    //    nt.makeGenInfoBranch(geninfo);
159 >    initEfficiencyWeights();
160 >    /*
161 >    // Higgs only, pt reweighting
162 >    if( ctrl.mH <= 140 ) {
163 >      char wptname[256];
164 >      sprintf( wptname, "/data/blue/pharris/Flat/ntupler/root/weight_ptH_%i.root", ctrl.mH );
165 >      TFile * f_hpt = new TFile(wptname);
166 >      f_hpt->Print();
167 >      sprintf(wptname, "weight_hqt_fehipro_fit_%i", ctrl.mH);
168 >      h_w_hpt  = (TH1F*)(f_hpt->FindObjectAny(wptname));
169 >      h_w_hpt->Print();
170 >    }
171 >    */
172 >  } else {
173 >    initRunLumiRangeMap();
174 >  }
175  
176 <  //
177 <  // Loop
178 <  //--------------------------------------------------------------------------------------------------------------
176 >  //  initMuonIDMVA();
177 >  initMuonIsoMVA();
178 >  initElectronIDMVA();
179 >  initElectronIsoMVA();
180 >  initTrigger();
181 >  
182 >  
183 >  //##########################################################################
184 >  // Setup tree I/O
185 >  //##########################################################################
186    
187    //
188    // Access samples and fill histograms
189    TFile *inputFile=0;
190    TTree *eventTree=0;  
191 <  
130 <  // Data structures to store info from TTrees
131 <  mithep::TEventInfo *info    = new mithep::TEventInfo();
132 <  TClonesArray *electronArr   = new TClonesArray("mithep::TElectron");
133 <  TClonesArray *muonArr       = new TClonesArray("mithep::TMuon");
134 <  
135 <
136 <  TBranch *infoBr;
137 <  TBranch *electronBr;
138 <  TBranch *muonBr;
139 <
140 < //   chain->SetBranchStatus("*",0); //disable all branches
141 < //   chain->SetBranchStatus("Info", 1);
142 < //   chain->SetBranchStatus("Muon", 1);
143 < //   chain->SetBranchStatus("Electron", 1);
144 <
145 <  chain->SetBranchAddress("Info",       &info);
146 <  chain->SetBranchAddress("Electron", &electronArr);
147 <  chain->SetBranchAddress("Muon", &muonArr);
148 <
191 >  string currentFile("");
192  
193 +  // Data structures to store info from TTrees
194 +  mithep::EventHeader *info    = new mithep::EventHeader();
195 +  //  mithep::TGenInfo    *ginfo  = new mithep::TGenInfo();
196 +  mithep::Array<mithep::Electron>             *electronArr   = new mithep::Array<mithep::Electron>();
197 +  mithep::Array<mithep::Muon>                 *muonArr       = new mithep::Array<mithep::Muon>();
198 +  mithep::Array<mithep::Vertex>               *vtxArr        = new mithep::Array<mithep::Vertex>();
199 +  mithep::Array<mithep::PFCandidate>          *pfArr         = new mithep::Array<mithep::PFCandidate>();
200 +  mithep::Array<mithep::PileupEnergyDensity>  *puArr         = new mithep::Array<mithep::PileupEnergyDensity>();
201 +  mithep::Array<mithep::Track>                *trkArr        = new mithep::Array<mithep::Track>();
202 +  mithep::TriggerMask                         *trigMask      = new mithep::TriggerMask();
203 +  mithep::TriggerTable                        *hltTable      = new mithep::TriggerTable();
204 +  vector<string>                              *hltTableStrings  = new vector<string>();
205 +
206 +  TString fElectronName(Names::gkElectronBrn);
207 +  TString fMuonName(Names::gkMuonBrn);
208 +  TString fInfoName(Names::gkEvtHeaderBrn);
209 +  TString fPrimVtxName(Names::gkPVBrn);
210 +  TString fPFCandidateName(Names::gkPFCandidatesBrn);
211 +  TString fPileupEnergyDensityName(Names::gkPileupEnergyDensityBrn);
212 +  TString fTrackName(Names::gkTrackBrn);
213 +  TString fTriggerMaskName(Names::gkHltBitBrn);
214 +  TString fTriggerTableName(Names::gkHltTableBrn);
215 +  
216 +  chain->SetBranchAddress(fInfoName,        &info);
217 +  chain->SetBranchAddress(fElectronName,    &electronArr);
218 +  chain->SetBranchAddress(fMuonName,        &muonArr);
219 +  chain->SetBranchAddress(fPrimVtxName,     &vtxArr);
220 +  chain->SetBranchAddress(fPFCandidateName, &pfArr);
221 +  chain->SetBranchAddress(fPileupEnergyDensityName, &puArr);
222 +  chain->SetBranchAddress(fTrackName, &trkArr);
223 +  chain->SetBranchAddress(fTriggerMaskName, &trigMask);
224 +  cout << "hlttable: " << fTriggerTableName << endl;
225 +  hltchain->SetBranchAddress(fTriggerTableName, &hltTableStrings);
226 +
227 +  mithep::Vertex              vtx;          // best primary vertex in the event
228 +
229 +  //  ginfo = NULL;
230 +  // if( ctrl.mc ) { chain->SetBranchAddress("Gen",        &ginfo);}
231 +
232 +  int count=0, pass=0;
233 +  float passcorr=0., passcorr_errup=0., passcorr_errdown=0.;
234 +  float denom[3]={0.,0.,0.};
235 +  float numer[3]={0.,0.,0.};
236 +  float numercorr[3]={0.,0.,0.};
237 +
238 +  // only 1 HLT table / file ???
239 +  hltchain->GetEntry(0);
240 +  cerr << "here... " << endl;
241 +
242 +  int imax = chain->GetEntries();
243 +  cout << "nEntries: " << imax << endl;
244 +
245 +
246 +  //##########################################################################
247 +  // Loop !!!!!!!!! should alternate events here and +1 in the training ...
248 +  //##########################################################################
249 +  for(UInt_t ientry=0; ientry<imax; ientry++)
250 +    {
251 +      chain->GetEntry(ientry);
252 +      if(!(ientry%1000)) cerr << "entry: " << ientry << endl;
253 +
254 +      setPV( ctrl, vtxArr, vtx);
255 +
256 +      if(ctrl.mc) {
257 +        weights.w = getWeight(xstab,entrymap,chain);
258 +      } else {
259 +        if( string(chain->GetFile()->GetEndpointUrl()->GetFile()) != currentFile ) {
260 +          currentFile = string(chain->GetFile()->GetEndpointUrl()->GetFile());
261 +          hltchain->SetBranchAddress(fTriggerTableName, &hltTableStrings);
262 +          hltchain->GetEntry(0);
263 +          hltTable->Clear();
264 +          fillTriggerBits(hltTable, hltTableStrings );
265 +        }
266 +        if( ctrl.debug ) cout << "file is : " << currentFile  << endl;
267 +        fillTriggerBits( hltTable, trigMask, triggerBits );
268 +      }
269 +      
270 +      
271 +      //
272 +      // trigger
273 +      //
274 +      if( !ctrl.mc ) {
275 +        if( !passHLT(triggerBits, info->RunNum(), info->EvtNum() ) ) {
276 +          if( ctrl.debug ) cout << "\tfails trigger ... " << endl;
277 +          continue;
278 +        }
279 +      }
280 +      
281 +      //
282 +      // lepton/kinematic selection ...
283 +      //
284 +      EventData ret4l =
285 +        apply_HZZ4L_reference_selection(ctrl, info,
286 +                              vtx,
287 +                              pfArr,
288 +                              puArr,
289 +                              electronArr,
290 +                              &electronReferencePreSelection,
291 +                              &electronReferenceIDMVASelection,
292 +                              &electronReferenceIsoSelection,
293 +                              muonArr,
294 +                              &muonReferencePreSelection,
295 +                              &muonIDPFSelection,
296 +                              &muonReferenceIsoSelection);
297 +      if( ctrl.debug ) cout << endl;
298 +
299 +      cout << "bits: " << ret4l.status.selectionBits << endl;
300 +      
301 +      if( ret4l.status.pass() ) {
302 +        
303 +        fillAngles(ret4l,angles);
304 +        fillKinematics(ret4l,kinematics);
305 +        fillEventInfo(info,evtinfo);
306 +        //if(ctrl.mc) fillGenInfo(ginfo,geninfo);
307 +        
308 +        /*
309 +        // only for Higgs < 140
310 +        geninfo.weight *= h_w_hpt->GetBinContent(h_w_hpt->FindBin(geninfo.pt_zz));
311 +        angles.bdt = reader->EvaluateMVA("BDTG");
312 +        */
313 +        nt.Fill();
314 +        
315 +        cerr  << "PASS:: "
316 +              << "\trun: " << evtinfo.run
317 +              << "\tevt: " << evtinfo.evt
318 +              << "\tlumi: " << evtinfo.lumi
319 +              << "\tcostheta1: " << angles.costheta1
320 +              << "\tcostheta2: " << angles.costheta2
321 +              << "\tcostheta*: " << angles.costhetastar
322 +              << "\tbdt: " << angles.bdt
323 +              << endl;
324 +        pass++;
325 +        //      if( pass > 3 ) break;
326  
327 <  cout << "nEntries: " << chain->GetEntries() << endl;
328 <  for(UInt_t ientry=0; ientry<chain->GetEntries(); ientry++) {
153 <
154 <    chain->GetEntry(ientry);
155 <    if(!(ientry%100000)) cout << "entry: " << ientry << endl;
156 <
157 <    // get event weight for this file                                                    
158 <    double eventweight=1;
159 <    if(ctrl.mc) eventweight = getWeight(xstab,entrymap,chain);
160 <
161 < #ifdef THEIR_EVENTS
162 <    if( !( info->evtNum == 504867308  ||
163 <           info->evtNum == 368148849  ||
164 <           info->evtNum == 129514273  ||
165 <           info->evtNum == 286336207  ||
166 <           info->evtNum == 344708580  ||
167 <           info->evtNum == 30998576   ||
168 <           info->evtNum == 155679852  ||
169 <           info->evtNum == 394010457  ||
170 <           info->evtNum == 917379387  ||
171 <           info->evtNum == 78213037   ||
172 <           info->evtNum == 337493970  ||
173 <           info->evtNum == 1491724484 ||
174 <           info->evtNum == 480301165  ||
175 <           info->evtNum == 1038911933 ||
176 <           info->evtNum == 876658967  ||
177 <           info->evtNum == 966824024  ||
178 <           info->evtNum == 141954801  ||
179 <           info->evtNum == 160966858  ||
180 <           info->evtNum == 191231387  ||
181 <           info->evtNum == 66033190   ||
182 <           info->evtNum == 10347106   ||
183 <           info->evtNum == 107360878  ) ) continue;
184 < #endif
185 <
186 <
187 < #ifdef BDTFAIL_THEIR_EVENTS
188 <    if( !( info->evtNum == 78213037   ||
189 <           info->evtNum == 876658967  ) ) continue;
190 <          
191 < #endif
192 <
193 <    unsigned evtfail = fails_HZZ4L_selection(ctrl, info, electronArr, muonArr, eventweight, passtuple);    
194 <    h_evtfail->Fill( evtfail, eventweight );
195 <
196 <          
197 <  } //end loop over data    
198 <
199 <
200 <
201 <  delete info;
202 <  delete electronArr;
203 <  delete muonArr;
204 <
205 <
206 <
207 <  //--------------------------------------------------------------------------------------------------------------
208 <  // Save Histograms;
209 <  //==============================================================================================================
210 <  const char * ofname;
211 <  if( strcmp( ctrl.outputfile.c_str(), "") ) {
212 <    ofname = ctrl.outputfile.c_str();
213 <  } else {
214 <    ofname = "tmp.root";
215 <  }
216 <
217 <  TFile *file = new TFile(ofname, "RECREATE");
218 <  h_evt->Write();
219 <  h_evtfail->Write();
220 <  passtuple->Write();
221 <  file->Close();
222 <  delete file;
223 <
224 <  // map<TString,TMVA::Reader*>::iterator it;
225 <  // for(it=readers.begin(); it!=readers.end(); it++) delete (*it).second;
327 >      }
328 >    }  
329  
330 <  cerr << "done!" << endl;
330 >  nt.WriteClose();
331   }
332  
333 <
334 <
333 > //----------------------------------------------------------------------------
334 > //
335 > // Get primary vertices
336 > // Assumes primary vertices are ordered by sum-pT^2 (as should be in CMSSW)
337 > // NOTE: if no PV is found from fitting tracks, the beamspot is used
338 > //
339 > //----------------------------------------------------------------------------
340 > bool setPV(ControlFlags ctrl,
341 >           const mithep::Array<mithep::Vertex> * vtxArr,
342 >           mithep::Vertex & vtx)
343 > //----------------------------------------------------------------------------
344 > {
345 >  const Vertex *bestPV = 0;
346 >  float best_sumpt=-1;
347 >
348 >  // good PV requirements
349 >  const UInt_t   fMinNTracksFit = 0;
350 >  const Double_t fMinNdof       = 4;
351 >  const Double_t fMaxAbsZ       = 24;
352 >  const Double_t fMaxRho        = 2;
353 >  
354 >  for(int i=0; i<vtxArr->GetEntries(); ++i) {
355 >    const Vertex *pv = (Vertex*)(vtxArr->At(i));
356 >    if( ctrl.debug ) cout << "vertex :: " << i << "\tntrks: " << pv->NTracks() << endl;
357 >    
358 >    // Select best PV for corrected d0; if no PV passing cuts, the first PV in the collection will be used
359 >    //  if(!pv->IsValid()) continue;
360 >    if(pv->NTracksFit()       < fMinNTracksFit)       continue;
361 >    if(pv->Ndof()                 < fMinNdof)         continue;
362 >    if(fabs(pv->Z()) > fMaxAbsZ)                      continue;
363 >    if(pv->Position().Rho()   > fMaxRho)              continue;    
364 >    
365 >    // take the first ...
366 >    bestPV = pv;
367 >    break;
368 >
369 >    // this never reached ...    
370 >    float tmp_sumpt=0;
371 >    for( int t=0; t<pv->NTracks(); t++ )
372 >      tmp_sumpt += pv->Trk(t)->Pt();
373 >    
374 >    if( tmp_sumpt > best_sumpt  ) {
375 >      bestPV = pv;
376 >      best_sumpt = tmp_sumpt;
377 >      if( ctrl.debug) cout << "new PV set, pt : " << best_sumpt << endl;
378 >    }
379 >  }
380 >  
381 >  if(!bestPV) bestPV = vtxArr->At(0);
382 >  vtx.SetPosition(bestPV->X(),bestPV->Y(),bestPV->Z());
383 >  vtx.SetErrors(bestPV->XErr(),bestPV->YErr(),bestPV->ZErr());
384 >  return true;
385 > };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines