#include #include #include #include #include // as: copy from fileAnalyzer.cc // root stuff #include #include #include #include #include #include #include #include #include #include #include "RootHeader.h" #include "bcal_fadc.h" using namespace std; using namespace evio; int evtCount = 0; // prototypes void analyzeEvent(evioDOMTree &eventTree); void analyzeBank(evioDOMNodeP bankPtr); void initRootTree(const char* filename); // Define bit masks // F1 bit masks #define F1_RAW_DATA 0xFF000000 //-------------------------------------------------------------- int main(int argc, char **argv) { int cargc = 1; TApplication App("Diagnostic GUI", &cargc, argv); char filename[128]; strcpy(filename, argv[1]); try { // open the file cout << "open data file " << filename <toString() << endl << endl; exit(EXIT_FAILURE); } // done cout << endl << endl << " ***File analyzer done after " << evtCount << " events***" << endl << endl; // App.Run(); exit(EXIT_SUCCESS); } //------------------------------------------------------------------------------- void analyzeEvent(evioDOMTree &eventTree) { // cout << endl << endl << endl << "analyzing event " << evtCount << endl << endl; // get list of all banks in event evioDOMNodeListP bankList = eventTree.getNodeList(); #if 0 evioDOMNodeList::iterator iter; for(iter = bankList->begin(); iter!= bankList->end(); iter++){ cout << (*iter)->toString() << endl; const evioDOMNodeP np = *iter; // solaris bug... const vector *vec = np->getVector(); if(vec == NULL) cout << " NULL POINTER " << endl; else cout << " Vector Size = " << vec->size() << endl; } #endif crate = -1; // cout << " NEW EVENT " << endl; evioDOMNodeList::iterator iter; for(iter = bankList->begin(); iter!= bankList->end(); iter++){ // cout << (*iter)->toString() << endl; // cout << " Data Type = " << (*iter)->getContentType() << endl; // cout << " Tag = " << (*iter)->tag << endl; // cout << " Num = " << (int)(*iter)->num << endl; // if( ((*iter)->tag == 83) || ((*iter)->tag == 84)) // cout << (*iter)->tag << " " << crate << endl; if( (*iter)->getContentType() == 0x10){ switch ((*iter)->tag){ // if( ((*iter)->tag == 83) || ((*iter)->tag == 84)) // cout << " AA = " << (*iter)->tag << " " << crate << endl; // BCAL South // case 37: crate = 0; break; // case 38: crate = 1; break; // case 40: crate = 2; break; // case 41: crate = 3; break; // BCAL North // case 31: crate = 0; break; // case 32: crate = 1; break; // case 34: crate = 2; break; // case 35: crate = 3; break; // case 37: crate = 4; break; // case 38: crate = 5; break; // case 40: crate = 6; break; // case 41: crate = 7; break; // BCAL // case 35: crate = 0; break; // case 38: crate = 0; break; // FCAL // NORTH // case 14: crate = 0; break; // SOUTH // case 19: crate = 0; break; // case 17: crate = 0; break; // case 34: crate = 0; break; // BCAL // case 31: crate = 0; break; // BCAL 11 // case 41: crate = 0; break; // case 73: crate = 1; break; // TAGH // case 73: crate = 0; break; // TAGM // case 71: crate = 0; break; // case 77: crate = 3; break; // PS1 // case 83: crate = 0; break; // PS2 // case 84: crate = 1; break; // ST // case 94: crate = 0; break; // FCAL case 40: crate = 0; break; #if 0 // FCAL case 11: crate = 0; break; case 12: crate = 1; break; case 13: crate = 2; break; case 14: crate = 3; break; case 15: crate = 4; break; case 16: crate = 5; break; case 17: crate = 6; break; case 18: crate = 7; break; case 19: crate = 8; break; case 20: crate = 9; break; case 21: crate = 10; break; case 22: crate = 11; break; #endif default: crate = -1; break; } // if(crate >= 0) // cout << " CC = " << (*iter)->tag << " " << crate << endl; } if(crate >= 0) // FADC250 if( ((*iter)->getContentType() == 0x1) && ((*iter)->tag == fadc_tag)){ cout << " RR = " << (*iter)->tag << " " << crate << endl; cout << " I am here " << endl; analyzeBank(*iter); } // F1TDC // if( ((*iter)->getContentType() == 0x1) && ((*iter)->tag == 26)) analyzeBank(*iter); } } //------------------------------------------------------------------------------- void analyzeBank(evioDOMNodeP bankPtr) { int SlotID = -1; int trigger_numb[max_fadc_board]; memset(trigger_numb,0,sizeof(trigger_numb)); // SASCHA // cout << endl; // cout << " Inside FADC bank analyzer " << bankPtr->getParent()->getContentType() << endl; // cout << " Inside FADC bank analyzer " << id_crate[bankPtr->getParent()->tag] << " Crate = " << crate << endl; // cout << endl; // decode banks switch (bankPtr->tag) { // header bank case 0: // cout << "found event bank" << endl << endl; break; case 3: { const vector *vec = bankPtr->getVector(); if(vec==NULL) {cerr << "?unable to get header bank vector" << endl; return;} // cout << dec << "found header bank: run number " << (*vec)[0] << " Event number " << (*vec)[1] << endl << endl; break; } // FADC data bank case 6: { int debug_fadc = 0; const vector *vec = bankPtr->getVector(); if(vec==NULL) {cerr << "?unable to get fadc bank vector" << endl; return;} int my_samp[100]; memset(my_samp,0,sizeof(my_samp)); // Loop over data unsigned int data_new_type = 0; unsigned int data_type = 0; int channel = -1 ; unsigned int fadc_raw_wind_width = 0; SlotID = -1; unsigned int time_stamp = 0; unsigned int pulse_number = -1; unsigned int first_sample = -1; int max_tac_amp = 0; // Alex // cout << " Vector Size = " << vec->size() << endl; for (unsigned i = 0; i < vec->size(); i++){ // Bank header // bit 31 = 1 // bits 27- 30 = 0 // bits 22 - 26 = SlotID // bits 11 - 21 = Number of events in block; bits 0 - 10 event block number if( (*vec)[i] >> 27 == 0x10) /* Bank header 1000 0 */ { SlotID = ((*vec)[i] & 0x7c00000) >> 22; if(debug_fadc) cout << " FADC found in slot: " << SlotID << endl; } // Event header // bit 31 = 1 // bits 27- 30 = 0x1001 // bits 0 - 26 = Trigger number if( (*vec)[i] >> 27 == 0x12) /* Event header 1001 0 */ { // trigger_numb[nboard] = ((*vec)[i] & 0x7FFFFFF); if(debug_fadc) // cout << " Event header: FADC found in slot: " << SlotID << " Trigger time " << hex << ((*vec)[i] & 0x7FFFFFF) << cout << " Event header: FADC found in slot: " << SlotID << " Event number " << ((*vec)[i] & 0x3FFFFF) << endl; } if( (*vec)[i] >> 27 == 0x13) /* Event header 1001 0 */ { if(debug_fadc) cout << " Trigger Time: " << hex << ((*vec)[i] & 0xFFFF) << dec << endl; } if( (*vec)[i] & 0x80000000 ) /* data type defining word */ { data_type = ((*vec)[i] & 0x78000000) >> 27; // data_type == 4 - window raw data // data_type == 6 - pulse raw data data_new_type = 1; } else { data_new_type = 0; }; // cout << " Data type = " << data_type << endl; #if 1 // WINDOW RAW DATA if(data_type == 4 ){ int raw_debug = 1; if(data_new_type == 1){ // cout << " Data type = " << data_type << endl; fadc_raw_wind_width = ((*vec)[i] & 0xFFF); channel = ((*vec)[i] & 0x7800000) >> 23; // cout << " Data Type = " << data_type << " Fadc_width = " << fadc_raw_wind_width << " Channel = " << channel << endl; time_stamp = 1; nhit ++; // cout << " Data Type = " << data_type << " NHIT = " << nhit << " Fadc_width = " << fadc_raw_wind_width << " Crate = " << crate << // " SLOT = " << SlotID << " Channel = " << channel << endl; // SASCHA // cout << " NEW CHANNEL = " << channel << " CRATE = " << crate << " SLOT = " << SlotID << " NHIT = " << nhit << endl; max_tac_amp = 0; } else{ unsigned int valid_1 = 1; unsigned int valid_2 = 1; unsigned int adc_1 = ((*vec)[i] & 0x1FFF0000) >> 16; if((*vec)[i] & 0x20000000 ) valid_1 = 0; unsigned int adc_2 = ((*vec)[i] & 0x1FFF); if( (*vec)[i] & 0x2000 ) valid_2 = 0; #if 0 // DEBUG SASCHA if(adc_1 > 164 || adc_2 > 164) if(raw_debug) cout << " Time stamp = " << time_stamp << " Crate " << crate << " SlotID = " << SlotID << " Channel = " << channel << " ADC1 = " << float(adc_1) << " " << float(adc_2) << endl; #endif // if(crate == 101) // if(adc_1 > 105 || adc_2 > 105) cout << " above threshold " << endl; // ALEX cout << " Time stamp = " << time_stamp << " SlotID = " << SlotID << " Channel = " << channel << " ADC1 = " << float(adc_1) << " " << float(adc_2) << endl; if(SlotID > 0){ int stamp_tmp = 2*(time_stamp - 1); my_samp[stamp_tmp] = adc_1; my_samp[stamp_tmp+1] = adc_2; if(time_stamp == 50){ int ind = 0; int int_sum = 0; for(int kk = 0; kk < 100; kk++){ // BCAL check if(my_samp[kk] > 105){ // TAGH // if(my_samp[kk] > 130){ ind = kk; break; } } // cout << " Index = " << ind << endl; if(ind > 5 && ind < 70){ // Run20756 NSB = 1, NSA = 26 // for(int rr = ind - 1; rr < ind + 26; rr++){ // Run20758 NSB = -2, NSA = 13 // for(int rr = ind + 1 ; rr < ind + 17; rr++){ for(int rr = ind + 2 ; rr < ind + 13; rr++){ // TAGM check // for(int rr = ind - 3; rr < ind + 6; rr++){ int_sum += my_samp[rr]; } } else { // cout << " Index = " << ind + 1 << endl; } cout << endl << endl; cout << " Emulated sum = " << int_sum << " Index = " << ind + 1 << endl; cout << " ---------------------------- " << endl << endl; cout << endl << endl; } } if((channel >= 0) && (channel < 16)){ // SASCHA // cout << " I am here: crate, slot, channel, time stamp " << crate << " " << SlotID << " " << // channel << " " << time_stamp << endl; // fadc_raw[nboard][channel][time_stamp*2-2] = float(adc_1); // fadc_raw[nboard][channel][time_stamp*2-1] = float(adc_2); if(ped[crate][SlotID][channel] == 0){ char title[30]; sprintf(title,"ped_cr%d_bd%d_ch%d",crate,SlotID,channel); cout << "!!Histogram does not exist!!" << endl; // SASCHA // ped[crate][SlotID][channel] = new TH1F(title,title,500,-0.5,499.5); ped[crate][SlotID][channel] = new TH1F(title,title,4095,-0.5,4094.5); } else { // cout << "Histogram already exists" << endl; } if(raw[crate][SlotID][channel] == 0){ char title[30]; sprintf(title,"raw_cr%d_bd%d_ch%d",crate,SlotID,channel); raw[crate][SlotID][channel] = new TProfile(title,title,window_size,-0.5,window_size-0.5, -10.,9000.); } else { } // SASCHA // cout << " NHIT = " << nhit << endl; // fadc[nboard][channel]->Fill(float(time_stamp*2-2),float(adc_1),1.); // fadc[nboard][channel]->Fill(float(time_stamp*2-1),float(adc_2),1.); ped[crate][SlotID][channel]->Fill(float(adc_1)); ped[crate][SlotID][channel]->Fill(float(adc_2)); hcrate[nhit-1] = crate; hslot[nhit-1] = SlotID; hch[nhit-1] = channel; nsamp[nhit-1] = fadc_raw_wind_width; // samp[time_stamp*2-2][nhit-1] = adc_1; // samp[time_stamp*2-1][nhit-1] = adc_2; samp[nhit-1][time_stamp*2-2] = adc_1; samp[nhit-1][time_stamp*2-1] = adc_2; raw[crate][SlotID][channel]->Fill(float(time_stamp*2-2),float(adc_1)); raw[crate][SlotID][channel]->Fill(float(time_stamp*2-1),float(adc_2)); if((SlotID == 20) && (channel == 0)){ if(adc_1 > max_tac_amp) max_tac_amp = adc_1; if(adc_2 > max_tac_amp) max_tac_amp = adc_2; int max_samp = time_stamp*2 - 1; if(max_samp == 99) htac_amp->Fill(float(max_tac_amp - 100)); } // SASCHA // cout << " SASCHA " << samp[time_stamp*2-2][nhit-1] << " Time stamp = " << time_stamp << " nhit = " << nhit << endl; // if(adc_1 > 400) cout << " SLOT = " << SlotID << " Channel = " << channel << " " << " Amp = " << adc_1 << " " << time_stamp << endl; // cout << " FILL TREE: CRATE = " << crate << " SLOT = " << SlotID << " NHIT = " << nhit << endl; } else {cout << " Wrong channel number " << channel << endl;} //exit(EXIT_FAILURE);} time_stamp++; } } // Data type 4, raw window data #endif int pulse_debug = 0; #if 0 // RAW PULSE DATA if(data_type == 6 ){ if(data_new_type == 1){ channel = ((*vec)[i] & 0x7800000) >> 23; pulse_number = ((*vec)[i] & 0x600000) >> 21; first_sample = ((*vec)[i] & 0x3FF); if(pulse_debug){ cout << endl; cout << " Data Type = " << data_type << " Channel = " << channel << " Pulse number = " << pulse_number << " First sample = " << first_sample << endl; cout << endl; } time_stamp = 1; } else{ unsigned int valid_1 = -1; unsigned int valid_2 = -1; unsigned int adc_1 = ((*vec)[i] & 0x1FFF0000) >> 16; valid_1 = ((*vec)[i] & 0x20000000 ) >> 29; unsigned int adc_2 = ((*vec)[i] & 0x1FFF); valid_2 = ( (*vec)[i] & 0x2000 ) >> 13; if((channel >= 0) && (channel < 16)){ int sample1 = time_stamp*2 - 2 + first_sample; int sample2 = time_stamp*2 - 1 + first_sample; if(sample2 > window_size){ if(pulse_debug) cout << " WRONG PULSE MODE ----- First Sample " << first_sample << " Time stamp " << time_stamp << endl; // continue; } if( (sample2 < 100) && (sample1 < 100)) { // fadc_pulse[nboard][channel][sample1] = float(adc_1); // fadc_pulse[nboard][channel][sample2] = float(adc_2); } if(pulse_debug) cout << " Ch = " << channel << " Words = " << time_stamp << " Sample 1 = " << sample1 << " Sample 2 = " << sample2 << " ADC 1 = " << float(adc_1) << " Valid1 " << valid_1 << " ADC 2 = " << float(adc_2) << " Valid2 " << valid_2 << endl; } else {cout << " Wrong channel number " << channel << endl; } //exit(EXIT_FAILURE);} time_stamp++; } } // Data type 6, pulse raw data #endif #if 1 // Pulse Integral data if(data_type == 9 ){ if(data_new_type == 1){ // cout << " Data type = " << data_type << endl; channel = (((*vec)[i]) >> 15) & 0xF; int pedestal_sum = ((*vec)[i] & 0x3FFF); int pedestal_quality = ((*vec)[i] >> 14) & 0x1; cout << "Pulse Parameters Ch = " << channel << " Pedestal Sum = " << pedestal_sum << " Ped quality = " << pedestal_quality << endl; unsigned int pulse_numb = ((*vec)[i] & 0x200000) >> 21; unsigned int pulse_int = ((*vec)[i] & 0x3FFFF); cout << " Channel = " << channel << " Pulse number = " << pulse_numb << " Pulse int = " << pulse_int << endl; // pulse_int = pulse_int - 13.4*12.; } else { if( ((((*vec)[i]) >> 30) & 0x1) == 1){ int integral = ((((*vec)[i]) >> 12) & 0x3FFFF); int int_quality = ((((*vec)[i]) >> 9) & 0x7); int int_samp_over_thr = (((*vec)[i]) & 0x1FF); cout << endl; cout << "Integral = " << integral << " Int quality = " << int_quality << " Samp over thr = " << int_samp_over_thr; if(integral == 2447) cout << " HERE IS OUR EVENT " << endl; } if( ((((*vec)[i]) >> 30) & 0x1) == 0){ int coarse_time = ((((*vec)[i]) >> 21) & 0xFF); int fine_time = ((((*vec)[i]) >> 15) & 0x3F); int time_quality = ((*vec)[i] & 0x3); int peak_amp = ((((*vec)[i]) >> 3) & 0xFFF); cout << " Coarse time = " << coarse_time << " Fine time = " << fine_time << " Time quality " << time_quality << " Peak = " << peak_amp << endl; } } } #endif // for(Int_t nb = 0; nb < nboard; nb++){ // if(trigger_numb[0] != trigger_numb[nb]){ // cout << " FATAL: Trigger number mismatch " << trigger_numb[0] << " " << trigger_numb[nb] << endl; // exit(EXIT_FAILURE); // } // if(debug_fadc) // cout << " Trigger number " << trigger_numb[0] << " " << trigger_numb[1] << " " << trigger_numb[2] << endl; // } // Pulse Integral data if(data_type == 7 ){ channel = ((*vec)[i] & 0x7800000) >> 23; unsigned int pulse_numb = ((*vec)[i] & 0x200000) >> 21; unsigned int pulse_int = ((*vec)[i] & 0x3FFFF); // cout << " Channel = " << channel << " Pulse number = " << pulse_numb << // " Pulse int = " << pulse_int << endl; // pulse_int = pulse_int - 13.4*12.; } } // for(Int_t nb = 0; nb < nboard; nb++){ // if(trigger_numb[0] != trigger_numb[nb]){ // cout << " FATAL: Trigger number mismatch " << trigger_numb[0] << " " << trigger_numb[nb] << endl; // exit(EXIT_FAILURE); // } // if(debug_fadc) // cout << " Trigger number " << trigger_numb[0] << " " << trigger_numb[1] << " " << trigger_numb[2] << endl; // } break; // FADC bank } case 8: { const vector *vec = bankPtr->getVector(); if(vec==NULL) {cerr << "?unable to get tdc bank vector" << endl; return;} int debug = 0; if(debug) cout << " CAEN1290 TDC BANK FOUND " << vec->size() << " Event number " << (*vec)[0] << endl; Float_t ttrig = 0.; Float_t tsig = 0.; for (unsigned i = 0; i < vec->size(); i++){ if( ((*vec)[i] >> 27) == 1){ unsigned int tdc = ((*vec)[i] & 0x3000000) >> 23; if(debug) cout << " TDC header found " << " TDC = " << tdc << " i = " << i << endl; } // cout << " CHECK " << ((*vec)[i] >> 27) << endl; // if( ((*vec)[i] >> 27) == 4){ // cout << " ERROR = " << ((*vec)[i] & 0x7FFF) << endl; // } // TDC measurement if( ((*vec)[i] >> 27) == 0){ unsigned int tdc_channel = ((*vec)[i] & 0x3e00000) >> 21; unsigned int tdc_time = ((*vec)[i] & 0x1FFFFF); if(tdc_channel == 1) ttrig = tdc_time; if(tdc_channel == 2) tsig = tdc_time; if(debug) cout << " TDC channel " << tdc_channel << " TDC time = " << tdc_time << endl; } } if((ttrig > 0) && (tsig > 0)){ Float_t dt = Float_t(ttrig - tsig); cout << dt*25 << endl; } break; // CAEN TDC } // CAEN QDC V792 case 26: { cout << " I AM HERE " << endl; int debug_tdc = 1; const vector *vec = bankPtr->getVector(); if(vec==NULL) {cerr << "?unable to get tdc bank vector" << endl; return;} if(debug_tdc){ cout << " -------------------" << endl; cout << " F1TDC Vector Size = " << vec->size() << endl; cout << " -------------------" << endl; } debug_tdc = 1; int block_head = 0; int slot = -1; int mod_id = -1; int block_numb = -1; int nevt_block = -1; int trig_numb = -1; int trig_time = -1; int chip_stat = -1; int hit_fifo_over = -1 ; int out_fifo_over = -1; int chip_numb = -1; int chip_chan = -1; int channel = -1; int time = -1; int ch_tmp = -1; // Loop over data // cout << " -------------------" << endl; // cout << " F1TDC Vector Size = " << vec->size() << endl; // cout << " -------------------" << endl; for (unsigned i = 0; i < vec->size(); i++){ // cout << ((*vec)[i] >> 27) << endl; if( ((*vec)[i] >> 27) == F1_BLOCK_HEAD){ if(block_head != 0){ cout << " FATAL: Missing global trailer " << endl; // exit(EXIT_FAILURE); } slot = ((*vec)[i] & F1_SLOT) >> 22; mod_id = ((*vec)[i] & F1_ID) >> 18; block_numb = ((*vec)[i] & F1_BLOCK) >> 8; nevt_block = ((*vec)[i] & F1_NEVT_BLOCK); if(debug_tdc) cout << " BLOCK HEADER " << " SLOT = " << slot << " ID = " << mod_id << " BLOCK NUMBER = " << block_numb << " NEVT_BLOCK = " << nevt_block << endl; block_head = 1; } if( ((*vec)[i] >> 27) == F1_EVENT_HEAD){ slot = ((*vec)[i] & F1_SLOT) >> 22; trig_numb = ((*vec)[i] & F1_TRIG_NUMB); if(debug_tdc) cout << " EVENT HEADER " << " SLOT = " << slot << " Trigger number = " << trig_numb << endl; } // Trigger Time if( ((*vec)[i] >> 27) == F1_TRIG_TIME){ trig_time = ((*vec)[i] & F1_TDE); if(debug_tdc) cout << " TRIGGER TIME DE " << trig_time << endl; } if( ((*vec)[i] >> 27) == 0){ trig_time = ((*vec)[i] & F1_TDE); if(debug_tdc) cout << " TRIGGER TIME AB " << trig_time << endl; } if( ((*vec)[i] >> 27) == F1_MEAS){ chip_stat = (((*vec)[i] >> 26) & 0x1); hit_fifo_over = (((*vec)[i] >> 25) & 0x1); out_fifo_over = (((*vec)[i] >> 24) & 0x1); chip_numb = ((*vec)[i] & F1_CHIP) >> 19; chip_chan = ((*vec)[i] & F1_CHAN) >> 16; time = ((*vec)[i] & F1_TIME); ch_tmp = -1; if( (chip_chan == 0) || (chip_chan == 1)) ch_tmp = 0; if( (chip_chan == 2) || (chip_chan == 3)) ch_tmp = 1; if( (chip_chan == 4) || (chip_chan == 5)) ch_tmp = 2; if( (chip_chan == 6) || (chip_chan == 7)) ch_tmp = 3; if( (ch_tmp >= 0) && (ch_tmp < 4) ){ channel = chip_numb*4 + ch_tmp; } cout << " HITS: " << " Chip status = " << chip_stat << " Hit FIFO over = " << hit_fifo_over << " Out FIFO over " << out_fifo_over << endl; cout << " Chip = " << chip_numb << " Chip Chan = " << chip_chan << " Channel = " << channel << " Time = " << time << endl; } if( ((*vec)[i] >> 27) == F1_BLOCK_TRAIL){ if(block_head != 1){ cout << " FATAL: Missing global header " << endl; // exit(EXIT_FAILURE); } block_head = 0; } } // Loop over TDC data words break; // CAEN TDC } default: { break; } } } //------------------------------------------------------------------------------- void initRootTree(const char* fname){ // open ROOT file ROOTfile = new TFile(fname,"RECREATE","new"); cout<<"Opened ROOT file "<cd(); tree1 = new TTree( "tree1", "FCAL fadc test" ); // tree2 = new TTree( "tree2", "FCAL f1tdc test" ); char var_name[30]; sprintf(var_name,"samp[%d][nhit]/I",window_size); tree1->Branch("nhit",&nhit,"nhit/I"); tree1->Branch("hcrate",&hcrate,"hcrate[nhit]/I"); tree1->Branch("hslot",&hslot,"hslot[nhit]/I"); tree1->Branch("hch",&hch,"hch[nhit]/I"); tree1->Branch("nsamp",&nsamp,"nsamp[nhit]/I"); // tree1->Branch("samp",&samp,var_name); // tree1->Branch("samp",&samp,"samp[60][nhit]/I"); tree1->Branch("samp",&samp,"samp[nhit][100]/I"); // tree2->Branch("ntdc",&ntdc,"ntdc/I"); // tree2->Branch("tdc_bd",&tdc_bd,"tdc_bd[ntdc]/I"); // tree2->Branch("tdc_ch",&tdc_ch,"tdc_ch[ntdc]/I"); // tree2->Branch("tdc_time",&tdc_time,"tdc_time[ntdc]/I"); // tree1->Branch("samp",&samp,"samp[window_size][nhit]/I"); // tree1->Branch( "fadc_pulse", &fadc_pulse, "fadc_pulse[2][16][200]/I" ); // tree1->Branch( "fadc_raw", &fadc_raw, "fadc_raw[2][16][200]/I" ); // int window_size = 35; // Profile histograms for fadcs operated in the raw window mode for(Int_t bd = 0; bd < max_fadc_board; bd++){ for(Int_t ch = 0; ch < 16; ch++){ char title[30]; sprintf(title,"fadc_%d_ch%d",bd,ch); // fadc[bd][ch] = new TProfile(title,title,window_size,-0.5,window_size-0.5,-10.,4096); } } htac_amp = new TH1F("htac_amp ","htac_amp",100,-0.5,4096.5); // 1D histograms for pedestals for(Int_t cr = 0; cr < max_fadc_crate; cr++){ for(Int_t bd = 0; bd < max_fadc_board; bd++){ for(Int_t ch = 0; ch < 16; ch++){ char title[30]; sprintf(title,"ped_cr%d_bd%d_ch%d",cr,bd,ch); // ped[cr][bd][ch] = new TH1F(title,title,100,0.,4095.); } } } // Profile histograms for the raw pulse mode for(Int_t bd = 1; bd < max_fadc_board; bd++){ for(Int_t ch = 0; ch < 16; ch++){ char title[30]; sprintf(title,"fadc_pulse_raw%d_ch%d",bd,ch); // fadc_pulse_raw[bd][ch] = new TProfile(title,title,window_size,-0.5,window_size-0.5,-10.,9000.); } } qdc1 = new TH1F("qdc 1 ","qdc 1",2048,-0.5,2047.5); qdc4 = new TH1F("qdc 4 ","qdc 4",4096,-0.5,4095.5); qdc0 = new TH1F("qdc 0 ","qdc 0",4096,-0.5,4095.5); } //------------------------------------------------------------------------------- //-------------------------------------------------------------------------------