r1 - 11 Oct 2010 - 23:40:14 - SeoKonKangYou are here: KoreaCmsWiki >  Main Web > TWikiUsers > SeoKonKang > LogBooks > ProjectLogBook > TrackCorrection > 2sigmaCorrection

-- SeoKonKang - 11 Oct 2010

TH2F* flattedtrack(TH2F* h){

 TH2F* h2 = h->Clone();
 int xNbins = h->GetNbinsX(); // eta nbins
 int yNbins = h->GetNbinsY(); // phi nbins

 for(int i=1;iGetBinContent(i,j);
                if(val_phi>max) max=val_phi;
                phi_sum=phi_sum+val_phi;
        }
        // get mean and 3sigma
        if(yNbins==0) return;
        double mean = phi_sum/yNbins;
        if(mean==0) continue;
        double sigma = (max-mean)/3.;
        for(int j=1;jGetBinContent(i,j);
                if( val<(mean-sigma) ){
                        int val_ = gRandom->Gaus(mean+sigma,sigma);
                        if(val>val_) val_=val;
                        h2->SetBinContent(i,j,val_);
                }
        }
 }


 return h2;
}

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
KOREA-CMS
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding KoreaCmsWiki? Send feedback