ROOT logo
Int_t readCms() 
{
// read CMS NSD data from file
//

cout << endl;
cout << "================================" << endl;
cout << endl;
cout << "read CMS NSD data from file" <<endl;
cout << "Number of bins: " << binsCms <<endl;
cout << "Filename:       " << filenameCms <<endl;
cout << endl;
cout << "================================" << endl;
cout << endl;

ifstream fileNsdCms;
fileNsdCms.open(filenameCms);

Int_t i = 0;
while(!fileNsdCms.eof()) {
    if(i == binsCms) break;
    // textfile content: pt:NSD_yield:(stat + syst error added linerarly)
    fileNsdCms >> centerPtCms[i] >> nsdCms[i] >> errNsdCms[i];
    
    ptCms[i]          = centerPtCms[i];
    
    // the width of the pt bins, currently hardwired....
    widthPtCms[i] = 0.1;
    if (centerPtCms[i] > 1) widthPtCms[i] = 0.2;
    
    errPtCms[i]       = widthPtCms[i] / 2.0;              
    lowPtCms[i]       = centerPtCms[i] - errPtCms[i];
    highPtCms[i]      = centerPtCms[i] + errPtCms[i];
    
    /*
    lowStatNsdCms[i]  = nsdCms[i] - statNsdCms[i];
    highStatNsdCms[i] = nsdCms[i] + statNsdCms[i];
    relStatNsdCms[i]  = statNsdCms[i] / nsdCms[i];    
    lowSystNsdCms[i]  = nsdCms[i] - systNsdCms[i];
    highSystNsdCms[i] = nsdCms[i] + systNsdCms[i];
    relSystNsdCms[i]  = systNsdCms[i] / nsdCms[i];    
    */    
    lowErrNsdCms[i]   = nsdCms[i] - errNsdCms[i];
    highErrNsdCms[i]  = nsdCms[i] + errNsdCms[i];
    relErrNsdCms[i]   = errNsdCms[i] / nsdCms[i];
    err2NsdCms[i]     = errNsdCms[i];
    lowErr2NsdCms[i]  = lowErrNsdCms[i];
    highErr2NsdCms[i] = highErrNsdCms[i];
    relErr2NsdCms[i]  = relErrNsdCms[i];
        
    cout << "ptCms[" << i << "]             = " << ptCms[i] <<endl;
    cout << "   centerPtCms[" << i << "]    = " << centerPtCms[i] <<endl;
    cout << "   widthPtCms[" << i << "]     = " << widthPtCms[i] <<endl;
    cout << "   errPtCms[" << i << "]       = " << errPtCms[i] <<endl;
    cout << "   lowPtCms[" << i << "]       = " << lowPtCms[i] <<endl;
    cout << "   highPtCms[" << i << "]      = " << highPtCms[i] <<endl;
    cout << "nsdCms[" << i << "]            = " << nsdCms[i] <<endl;
    /*
    cout << "   statNsdCms[" << i << "]     = " << statNsdCms[i] <<endl;
    cout << "   lowStatNsdCms[" << i << "]  = " << lowStatNsdCms[i] <<endl;
    cout << "   highStatNsdCms[" << i << "] = " << highStatNsdCms[i] <<endl;
    cout << "   relStatNsdCms[" << i << "]  = " << relStatNsdCms[i] <<endl;
    cout << "   systNsdCms[" << i << "]     = " << systNsdCms[i] <<endl;
    cout << "   lowSystNsdCms[" << i << "]  = " << lowSystNsdCms[i] <<endl;
    cout << "   highSystNsdCms[" << i << "] = " << highSystNsdCms[i] <<endl;
    cout << "   relSystNsdCms[" << i << "]  = " << relSystNsdCms[i] <<endl;
    */
    cout << "errNsdCms[" << i << "]         = " << errNsdCms[i] <<endl;
    cout << "   lowErrNsdCms[" << i << "]   = " << lowErrNsdCms[i] <<endl;
    cout << "   highErrNsdCms[" << i << "]  = " << highErrNsdCms[i] <<endl;
    cout << "   relErrNsdCms[" << i << "]   = " << relErrNsdCms[i] <<endl;
    cout << "err2NsdCms[" << i << "]        = " << err2NsdCms[i] <<endl;
    cout << "   lowErr2NsdCms[" << i << "]  = " << lowErr2NsdCms[i] <<endl;
    cout << "   highErr2NsdCms[" << i << "] = " << highErr2NsdCms[i] <<endl;
    cout << "   relErr2NsdCms[" << i << "]  = " << relErr2NsdCms[i] <<endl;
    cout << endl;
     
   i++;
} // while(!fileNsdCms.eof())
fileNsdCms.close();
//if (fileNsdCms) { delete fileNsdCms; }
//fileNsdCms=0;

cout << "================================" << endl;
cout << endl;
cout << "Finished reading CMS NSD data" <<endl;
cout << "Number of bins read: " << i <<endl;
cout << endl;
cout << "================================" << endl;
cout << endl;

return i;
 readCms.C:1
 readCms.C:2
 readCms.C:3
 readCms.C:4
 readCms.C:5
 readCms.C:6
 readCms.C:7
 readCms.C:8
 readCms.C:9
 readCms.C:10
 readCms.C:11
 readCms.C:12
 readCms.C:13
 readCms.C:14
 readCms.C:15
 readCms.C:16
 readCms.C:17
 readCms.C:18
 readCms.C:19
 readCms.C:20
 readCms.C:21
 readCms.C:22
 readCms.C:23
 readCms.C:24
 readCms.C:25
 readCms.C:26
 readCms.C:27
 readCms.C:28
 readCms.C:29
 readCms.C:30
 readCms.C:31
 readCms.C:32
 readCms.C:33
 readCms.C:34
 readCms.C:35
 readCms.C:36
 readCms.C:37
 readCms.C:38
 readCms.C:39
 readCms.C:40
 readCms.C:41
 readCms.C:42
 readCms.C:43
 readCms.C:44
 readCms.C:45
 readCms.C:46
 readCms.C:47
 readCms.C:48
 readCms.C:49
 readCms.C:50
 readCms.C:51
 readCms.C:52
 readCms.C:53
 readCms.C:54
 readCms.C:55
 readCms.C:56
 readCms.C:57
 readCms.C:58
 readCms.C:59
 readCms.C:60
 readCms.C:61
 readCms.C:62
 readCms.C:63
 readCms.C:64
 readCms.C:65
 readCms.C:66
 readCms.C:67
 readCms.C:68
 readCms.C:69
 readCms.C:70
 readCms.C:71
 readCms.C:72
 readCms.C:73
 readCms.C:74
 readCms.C:75
 readCms.C:76
 readCms.C:77
 readCms.C:78
 readCms.C:79
 readCms.C:80
 readCms.C:81
 readCms.C:82
 readCms.C:83
 readCms.C:84
 readCms.C:85
 readCms.C:86
 readCms.C:87
 readCms.C:88
 readCms.C:89
 readCms.C:90
 readCms.C:91
 readCms.C:92
 readCms.C:93