Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 08:19:05

0001 #include <uspin/SpinDBContent.h>
0002 #include <uspin/SpinDBOutput.h>
0003 
0004 
0005 R__LOAD_LIBRARY(libuspin.so)
0006 
0007 
0008 
0009 
0010 
0011 //****** Good GL1p scaler runs that need to be corrected *******//
0012 //******Xingshift should be set to 0 (and badrunqa set to 0) ********//
0013 
0014 // Unknown what went wrong (crossing shift set to -999 from 0xFFFF qa_level)
0015 //45891 46460 46620 47065 48821 49051 49221 49247 49377
0016 
0017 //this is 56 by 56 fill (fill 34907) but xingshiftcal gives xingshift = -999 when it should be 0
0018 //50441
0019 
0020 // this is an actual 28x28 fill (fill 34897), the crossing shift is properly set to 0 but spindbqa gets confused
0021 //49997 49998 49999 50000 50001 50002 50004 50005 50006 50007 50008 50009
0022 //50010 50011 50012 50013 50014 50015 50016 50017 50018 50019 
0023 //50020 50021 50022 50023 50024 50025  
0024 
0025 // 6x6 fill (fill 34886) xingshiftcal correct with xingshift = 0 but spindbqa gets confused
0026 //49678 49679 49680 49681 49682 49684 49685 49687
0027 //49688 49683 49694 49697 49699 49703 49705 49706 
0028 //49707 49708 49709 49710 49711 49712 49713 49714
0029 //49715 49716 49717 49718 49719 49720 49721 49722
0030 
0031 // 6x6 fill (fill 35020) xingshiftcal correct with xingshift = 0 but spindbqa gets confused
0032 // 52077 52078
0033 // *********** //
0034 
0035 
0036 //****** Bad GL1p scaler runs (set crossing shift to -999) *******//
0037 // These are runs where the bunch number distributions are all flat (i.e. no abort gap)
0038 //45237 45238 45239 45240 45241 45532 47075 47328 47388 47448 47449 47563
0039 //47564 47565 48308 48330 48332 48948 49343 50488 51608 51609 51610 51611
0040 //52893
0041 
0042 // Low counts (crossing shift set to -999 from 0xFFFF qa_level)
0043 //45393 47387 45436 45437 45442 45474
0044 //45475 45476 45533 45736 45743 46033 46621 46638
0045 //46639 46467 46468 46469 46470 46504 46734 46780
0046 //47069 47070 47071 47072 47076 47077 47085 47171 47172 47173 47174 47176 47206
0047 //47207 47209 47214 47215 47221 47223 47224 47225 47228
0048 //47400 47446 47447 47535 47536 47537 47544 47545 47546
0049 //47598 47600 47615 47648 47655 47773 47776
0050 //47850 47885 47887 48005 48094 48170 48171 48283 48316
0051 //48328 48333 48334 48340 48362 48401 48442
0052 //48443 48502 48503 48507 48508 48515 48644 48647 48648 48649 48650 48651 48652 48653
0053 //48654 48659 48718 48809 48833 48855 48978 49129
0054 //49461 49738 50042 50043 50371 50479 50480 50481 
0055 //50523 50532 50566 53682
0056 
0057 // Very low scaler counts (badrunqa=1?)           
0058 //45263 45320 45381 45382 45385 45396 45473 45523 45536
0059 //45556 45695 45720 45873 45931 46054 46426 46439 46489
0060 //46490 46491 46508 46509 46510 46511 46512 46513 46514
0061 //46515 46516 46517 46518 46519 46520 46521 46522 46578
0062 //46579 46580 46582 46592 46607 47073 47074 47326 47327
0063 //47335 47399 47401 47402 47418 47534 47560 47561 47562
0064 //47571 47774 48331 48339 48468 48642 48643 48992 48993
0065 //50038 50085 50086 52216 53621
0066 
0067 //MBD scalers are empty (or very close) but zdc scalers look fine (more or less)? (badrunqa=1?)
0068 //45387 45388 45694 45696 45697 45698 45699 45700 45707
0069 //45708 45709 45710 45711 45712 47107 47698 47753 48936
0070 //51223 51859 53214
0071 
0072 // In fill 34597, Bunch 0 has really low counts (badrunqa=1?)
0073 // looks like it would get messed up by zdcns because bunch 0 has 0 counts
0074 //45294 45295 45296 45297
0075 //45298 45299 45300 45301 45302 45303 45304 45305 45309 
0076 //45310 45311 45312 45314 45316 45318 45319
0077 
0078 //same bunch 0 issue as above but xingshiftcal has set xingshift to -999 (badrunqa=1?)
0079 //48400 48402 48403 48404 48405 48406 48407 48419 48420
0080 
0081 // something really weird here where it has assigned xingshift = 0 at qa_level = 0xFFFF but the gl1p scaler distributions
0082 // looks like they have large suppression in final 26 bunches? (badrunqa=1?)
0083 //51838 51840 51841 51842 51843 51848 51854 51855 51856 51858 51860
0084 
0085 // mbd scalers look good until the last bunch 119 has a lot of counts (same as non abort gap bunches) (badrunqa=1?)
0086 //45383 51369 
0087 
0088 //spindbqa gets confused (usually sees 10 0's near abort gap for zdcns) b.c. statistics are too low (just set crossingshift to -999 and badrunqa=1)
0089 //50937 51250
0090 
0091 //weird up and down alternating behavior of scalers even though it is 111x111 fill (badrunqa=1?)
0092 //49344 51157
0093 
0094 // 6x6 fill (fill 34886) xingshiftcal messes up with xingshift = 7 (badrunqa=1?)
0095 //49690
0096 
0097 // strange behavior in mbd scalers where abort gap looks like only last 4 bunches
0098 // and then first 5 bunches are about a quarter of what they are nominally (zdcns looks fine) (badrunqa=1?)
0099 //45526 
0100 
0101 // *********** //
0102 
0103 
0104 
0105 void checkGL1pScalers(int runnumber = 46515, unsigned int qa_level = 0xffff)
0106 {
0107   SpinDBContent spin_cont;
0108   SpinDBOutput spin_out("phnxrc");
0109 
0110   spin_out.StoreDBContent(runnumber,runnumber);
0111   //spin_out.StoreDBContent(runnumber,runnumber,qa_level);
0112   
0113   spin_out.GetDBContentStore(spin_cont,runnumber);
0114 
0115   ////////////////////////////////////////////////////
0116   // Get fill number
0117   int fillnumber = spin_cont.GetFillNumber();
0118   std::cout << "Fill Number: " << fillnumber << std::endl;
0119   ////////////////////////////////////////////////////
0120 
0121   ////////////////////////////////////////////////////
0122   // Get crossing shift
0123   int crossingshift = spin_cont.GetCrossingShift();
0124   std::cout << "Crossing shift: " << crossingshift << std::endl;
0125   ////////////////////////////////////////////////////
0126 
0127   ////////////////////////////////////////////////////
0128   // Get MBD NS GL1p scalers
0129   long long mbdns[120] = {0};
0130   std::cout << "MBDNS GL1p scalers: [";
0131   for (int i = 0; i < 120; i++)
0132   {
0133     mbdns[i] = spin_cont.GetScalerMbdNoCut(i);
0134     std::cout << mbdns[i];
0135     if (i < 119)std::cout << ", ";
0136   }
0137   std::cout << "]" << std::endl;
0138   ////////////////////////////////////////////////////
0139 
0140   ////////////////////////////////////////////////////
0141   // Get MBD VTX GL1p scalers
0142   long long mbdvtx[120] = {0};
0143   std::cout << "MBD VTX GL1p scalers: [";
0144   for (int i = 0; i < 120; i++)
0145   {
0146     mbdvtx[i] = spin_cont.GetScalerMbdVertexCut(i);
0147     std::cout << mbdvtx[i];
0148     if (i < 119)std::cout << ", ";
0149   }
0150   std::cout << "]" << std::endl;
0151   ////////////////////////////////////////////////////
0152 
0153 
0154   ////////////////////////////////////////////////////
0155   // Get ZDC NS GL1p scalers
0156   long long zdcns[120] = {0};
0157   std::cout << "ZDC NS GL1p scalers: [";
0158   for (int i = 0; i < 120; i++)
0159   {
0160     zdcns[i] = spin_cont.GetScalerZdcNoCut(i);
0161     std::cout << zdcns[i];
0162     if (i < 119)std::cout << ", ";
0163   }
0164   std::cout << "]" << std::endl;
0165   ////////////////////////////////////////////////////
0166 
0167 
0168 }