source: trunk/Mars/fact/processing/swtrig.C@ 18846

Last change on this file since 18846 was 18750, checked in by Daniela Dorner, 8 years ago
added (macro to exctract artificial trigger rates)
File size: 1.5 KB
Line 
1int swtrig(const char *fname)
2{
3 gEnv->GetValue("TFile.Recover", 0);
4 TChain c("Events");
5 if (c.AddFile(fname, 0)!=1)
6 {
7 gLog << "ERROR - Number of added files does not match 1." << endl;
8 return 1;
9 }
10
11 c.SetAlias("Baseline", "MSoftwareTrigger.fBaseline");
12 c.SetAlias("Signal", "MSoftwareTrigger.fAmplitude");
13 c.SetAlias("ID", "(0xff00&MRawEvtHeader.fTrigPattern[0])");
14 c.SetAlias("DATA", "ID==0x000");
15 c.SetAlias("CAL", "ID==0x100");
16 c.SetAlias("PED", "ID==0x400");
17 c.SetAlias("SELECT", "Baseline < (Signal/1000)^1.5+75");
18
19 Long64_t cnt27s = c.Draw("Signal", "!SELECT && DATA", "goff");
20
21 Long64_t cnt00500 = c.Draw("Signal", "SELECT && DATA && (Signal>500)", "goff");
22 Long64_t cnt00750 = c.Draw("Signal", "SELECT && DATA && (Signal>750)", "goff");
23 Long64_t cnt01000 = c.Draw("Signal", "SELECT && DATA && (Signal>1000)", "goff");
24 Long64_t cnt01250 = c.Draw("Signal", "SELECT && DATA && (Signal>1250)", "goff");
25 Long64_t cnt02500 = c.Draw("Signal", "SELECT && DATA && (Signal>2500)", "goff");
26 Long64_t cnt05000 = c.Draw("Signal", "SELECT && DATA && (Signal>5000)", "goff");
27 Long64_t cnt10000 = c.Draw("Signal", "SELECT && DATA && (Signal>10000)", "goff");
28
29 cout << "result ";
30 cout << cnt27s << ' ';
31 cout << cnt00500 << ' ';
32 cout << cnt00750 << ' ';
33 cout << cnt01000 << ' ';
34 cout << cnt01250 << ' ';
35 cout << cnt02500 << ' ';
36 cout << cnt05000 << ' ';
37 cout << cnt10000 << endl;
38
39 return 0;
40}
Note: See TracBrowser for help on using the repository browser.