Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:12

0001 //Auxiliary function
0002 void ProcessSubDetCT(TFile &ref_file, TFile &val_file, ifstream &ctstr, const int nHist1, const int nHist2, const int nProf, const int nHistTot, TString ref_vers, TString val_vers, int harvest=0);
0003 
0004 //Macro takes 3 parameters as arguments: the version to be validated, the reference version and a 2-bit integer that determines whether or not the samples are harvested
0005 void CombinedCaloTowers(TString ref_vers="210", TString val_vers="210pre6", int harvest=0){
0006   
0007   //Information contained in stream (in order): 
0008   //Name of histograms in root file, 1/0 switch whether they should be processed. If yes, then:
0009   //title of file where they should be saved, range of x-axis, range of y-axis (if not default)
0010   //Dimension of histogram, StatBox switch, Chi2 switch, logarithmic y-axis switch
0011   //color of reference histogram, color of validation histogram, title of histogram x-axis
0012   ifstream CalTowStream("InputCaloTowers.txt");
0013   
0014   //Specify files
0015   TFile HB_ref_file("HcalRecHitValidationHB_"+ref_vers+".root"); 
0016   TFile HE_ref_file("HcalRecHitValidationHE_"+ref_vers+".root"); 
0017   TFile HF_ref_file("HcalRecHitValidationHF_"+ref_vers+".root"); 
0018 
0019   TFile HB_val_file("HcalRecHitValidationHB_"+val_vers+".root");
0020   TFile HE_val_file("HcalRecHitValidationHE_"+val_vers+".root"); 
0021   TFile HF_val_file("HcalRecHitValidationHF_"+val_vers+".root"); 
0022   
0023   //Service variables
0024   const int HB_nHist1 = 7;
0025   const int HE_nHist1 = 7;
0026   const int HF_nHist1 = 7;
0027 
0028   const int HB_nHist2 = 2;
0029   const int HE_nHist2 = 2;
0030   const int HF_nHist2 = 2;
0031 
0032   const int HB_nProf = 2;
0033   const int HE_nProf = 2;
0034   const int HF_nProf = 2;
0035 
0036   const int HB_nHistTot = 20;
0037   const int HE_nHistTot = 20;
0038   const int HF_nHistTot = 20;
0039 
0040   //Order matters! InputCaloTowers.txt has histograms in the order HB-HE-HF
0041   ProcessSubDetCT(HB_ref_file, HB_val_file, CalTowStream, HB_nHist1, HB_nHist2, HB_nProf, HB_nHistTot, ref_vers, val_vers, harvest);
0042   ProcessSubDetCT(HE_ref_file, HE_val_file, CalTowStream, HE_nHist1, HE_nHist2, HE_nProf, HE_nHistTot, ref_vers, val_vers, harvest);
0043   ProcessSubDetCT(HF_ref_file, HF_val_file, CalTowStream, HF_nHist1, HF_nHist2, HE_nProf, HF_nHistTot, ref_vers, val_vers, harvest);
0044 
0045   //Close ROOT files
0046   HB_ref_file.Close();
0047   HE_ref_file.Close();
0048   HF_ref_file.Close();
0049 
0050   HB_val_file.Close();
0051   HE_val_file.Close();
0052   HF_val_file.Close();
0053   
0054   return;  
0055 }
0056 
0057 void ProcessSubDetCT(TFile &ref_file, TFile &val_file, ifstream &ctstr, const int nHist1, const int nHist2, const int nProf, const int nHistTot, TString ref_vers, TString val_vers, int harvest){
0058   
0059   TString RefHistDir, ValHistDir;
0060 
0061   if      (harvest == 11){
0062     RefHistDir = "DQMData/Run 1/CaloTowersV/Run summary/CaloTowersTask";
0063     ValHistDir = "DQMData/Run 1/CaloTowersV/Run summary/CaloTowersTask";
0064   }
0065   else if (harvest == 10){
0066     RefHistDir = "DQMData/CaloTowersV/CaloTowersTask";
0067     ValHistDir = "DQMData/Run 1/CaloTowersV/Run summary/CaloTowersTask";
0068   }
0069   else if (harvest == 1){
0070     RefHistDir = "DQMData/Run 1/CaloTowersV/Run summary/CaloTowersTask";
0071     ValHistDir = "DQMData/CaloTowersV/CaloTowersTask";
0072   }
0073   else{
0074     RefHistDir = "DQMData/CaloTowersV/CaloTowersTask";
0075     ValHistDir = "DQMData/CaloTowersV/CaloTowersTask";
0076   }
0077   
0078   TCanvas *myc = new TCanvas("myc","",800,600);
0079   
0080   TH1F* ref_hist1[nHist1];
0081   TH1F* val_hist1[nHist1];
0082 
0083   TH2F* ref_hist2[nHist2];
0084   TH2F* val_hist2[nHist2];
0085   
0086   TProfile* ref_prof[nProf];
0087   TProfile* val_prof[nProf];
0088 
0089   int i;
0090   int DrawSwitch;
0091   TString StatSwitch, Chi2Switch, LogSwitch, DimSwitch;
0092   int RefCol, ValCol;
0093   TString HistName, HistName2;
0094   char xAxisTitle[200];
0095   int nRebin;
0096   float xAxisMin, xAxisMax, yAxisMin, yAxisMax;
0097   TString OutLabel;
0098   
0099   int nh1 = 0;
0100   int nh2 = 0;
0101   int npi = 0;
0102 
0103   for (i = 0; i < nHistTot; i++){
0104     TLegend* leg = 0;
0105     TPaveText* ptchi2 = 0;
0106     TPaveStats *ptstats_r = 0;
0107     TPaveStats *ptstats_v = 0;
0108 
0109     //Read in 1/0 switch saying whether this histogram is used 
0110     //Skip it if not used, otherwise get output file label, histogram
0111     //axis ranges and title
0112     //Altered: Reads in all inputs and then uses 1/0 switch to skip
0113     ctstr>>HistName>>DrawSwitch;
0114 //    if (DrawSwitch == 0) continue;
0115     
0116     ctstr>>OutLabel>>nRebin;
0117     ctstr>>xAxisMin>>xAxisMax>>yAxisMin>>yAxisMax;
0118     ctstr>>DimSwitch>>StatSwitch>>Chi2Switch>>LogSwitch;
0119     ctstr>>RefCol>>ValCol;
0120     ctstr.getline(xAxisTitle,200);
0121     if (DrawSwitch == 0) continue;
0122     
0123     //Format pad
0124     if (LogSwitch == "Log") myc->SetLogy();
0125     else                    myc->SetLogy(0);
0126     
0127     if (StatSwitch == "Stat") myc->SetGrid(0,0);
0128     else                      myc->SetGrid();
0129     
0130     if (DimSwitch == "1D"){
0131       //Get histograms from files
0132       ref_file.cd(RefHistDir);   
0133       ref_hist1[nh1] = (TH1F*) gDirectory->Get(HistName);
0134 
0135       ref_hist1[nh1]->SetMarkerStyle(21);       
0136       ref_hist1[nh1]->SetMarkerSize(0.02);
0137 
0138       val_file.cd(ValHistDir);   
0139       val_hist1[nh1] = (TH1F*) gDirectory->Get(HistName);
0140 
0141       val_hist1[nh1]->SetMarkerStyle(21);       
0142       val_hist1[nh1]->SetMarkerSize(0.02);
0143 
0144 
0145       // HACK to change what is embedded in DQM histos
0146       ref_hist1[nh1]->GetXaxis()->SetLabelSize(0.04); 
0147       val_hist1[nh1]->GetXaxis()->SetLabelSize(0.04); 
0148       ref_hist1[nh1]->GetYaxis()->SetLabelSize(0.04); 
0149       val_hist1[nh1]->GetYaxis()->SetLabelSize(0.04); 
0150       ref_hist1[nh1]->GetXaxis()->SetTitleSize(0.045); 
0151       val_hist1[nh1]->GetXaxis()->SetTitleSize(0.045); 
0152 
0153       ref_hist1[nh1]->GetXaxis()->SetTickLength(-0.015);
0154       val_hist1[nh1]->GetXaxis()->SetTickLength(-0.015);      
0155       ref_hist1[nh1]->GetYaxis()->SetTickLength(-0.015);
0156       val_hist1[nh1]->GetYaxis()->SetTickLength(-0.015);
0157       
0158       ref_hist1[nh1]->GetXaxis()->SetLabelOffset(0.02);
0159       val_hist1[nh1]->GetXaxis()->SetLabelOffset(0.02);
0160       ref_hist1[nh1]->GetYaxis()->SetLabelOffset(0.02);
0161       val_hist1[nh1]->GetYaxis()->SetLabelOffset(0.02);
0162 
0163       ref_hist1[nh1]->GetXaxis()->SetTitleOffset(1.0); 
0164       val_hist1[nh1]->GetXaxis()->SetTitleOffset(1.0); 
0165 
0166       
0167       //Rebin histograms -- has to be done first
0168       if (nRebin != 1){
0169     ref_hist1[nh1]->Rebin(nRebin);
0170     val_hist1[nh1]->Rebin(nRebin);
0171       }
0172       
0173       //Set the colors, styles, titles, stat boxes and format x-axis for the histograms 
0174       if (StatSwitch != "Stat"){
0175     ref_hist1[nh1]->SetStats(kFALSE);
0176     val_hist1[nh1]->SetStats(kFALSE);
0177       }
0178       else {
0179     ref_hist1[nh1]->SetStats(kTRUE);
0180     val_hist1[nh1]->SetStats(kTRUE);
0181       }
0182 
0183       //Min/Max Convetion: Default AxisMin = 0. Default AxisMax = -1.
0184       //xAxis
0185       if (xAxisMin == 0) xAxisMin = ref_hist1[nh1]->GetXaxis()->GetXmin();
0186       if (xAxisMax <  0) xAxisMax = ref_hist1[nh1]->GetXaxis()->GetXmax();
0187       
0188       if (xAxisMax > 0 || xAxisMin != 0){
0189     ref_hist1[nh1]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0190     val_hist1[nh1]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0191       }      
0192       //yAxis
0193       if (yAxisMin != 0) ref_hist1[nh1]->SetMinimum(yAxisMin);   
0194       if (yAxisMax  > 0) ref_hist1[nh1]->SetMaximum(yAxisMax);
0195       else if (ref_hist1[nh1]->GetMaximum() < val_hist1[nh1]->GetMaximum() &&
0196            val_hist1[nh1]->GetMaximum() > 0){
0197     if (LogSwitch == "Log") ref_hist1[nh1]->SetMaximum(   2 * val_hist1[nh1]->GetMaximum());
0198     else                    ref_hist1[nh1]->SetMaximum(1.05 * val_hist1[nh1]->GetMaximum());
0199       }
0200       
0201       //Title
0202       ref_hist1[nh1]->GetXaxis()->SetTitle(xAxisTitle);
0203       
0204       //Different histo colors and styles
0205       ref_hist1[nh1]->SetTitle("");
0206       ref_hist1[nh1]->SetLineWidth(1); 
0207       ref_hist1[nh1]->SetLineColor(RefCol);
0208       ref_hist1[nh1]->SetLineStyle(1); 
0209       if (StatSwitch != "Stat") ref_hist1[nh1]->SetLineWidth(2); 
0210       
0211       val_hist1[nh1]->SetTitle("");
0212       val_hist1[nh1]->SetLineWidth(1); 
0213       val_hist1[nh1]->SetLineColor(ValCol);
0214       val_hist1[nh1]->SetLineStyle(2);
0215       if (StatSwitch != "Stat") val_hist1[nh1]->SetLineWidth(2); 
0216       
0217       //Chi2
0218       if (Chi2Switch == "Chi2"){
0219     //Draw histograms
0220     ref_hist1[nh1]->SetFillColor(40);//Originally 42. 
0221     ref_hist1[nh1]->Draw("hist"); // "stat"
0222 
0223     val_hist1[nh1]->SetLineStyle(1);
0224     val_hist1[nh1]->Draw("sames e0");
0225     //Get p-value from chi2 test
0226     const float NCHI2MIN = 0.01;
0227     
0228     float pval;
0229     stringstream mystream;
0230     char tempbuff[30];
0231       
0232     pval = ref_hist1[nh1]->Chi2Test(val_hist1[nh1]);
0233     
0234     sprintf(tempbuff,"Chi2 p-value: %6.3E%c",pval,'\0');
0235     mystream<<tempbuff;
0236     
0237     ptchi2 = new TPaveText(0.05,0.92,0.35,0.99, "NDC");
0238     
0239     if (pval > NCHI2MIN) ptchi2->SetFillColor(kGreen);
0240     else                 ptchi2->SetFillColor(kRed);
0241     
0242     ptchi2->SetTextSize(0.03);
0243     ptchi2->AddText(mystream.str().c_str());
0244     ptchi2->Draw();
0245       }
0246       else {
0247     //Draw histograms
0248     ref_hist1[nh1]->Draw("hist"); // "stat"
0249     val_hist1[nh1]->Draw("hist sames");
0250       }
0251       
0252       //StatBox
0253       if (StatSwitch == "Stat"){
0254     ptstats_r = new TPaveStats(0.85,0.86,0.98,0.98,"brNDC");
0255     ptstats_r->SetTextColor(RefCol);
0256     ref_hist1[nh1]->GetListOfFunctions()->Add(ptstats_r);
0257     ptstats_r->SetParent(ref_hist1[nh1]->GetListOfFunctions());
0258     
0259     ptstats_v = new TPaveStats(0.85,0.74,0.98,0.86,"brNDC");
0260     ptstats_v->SetTextColor(ValCol);
0261     val_hist1[nh1]->GetListOfFunctions()->Add(ptstats_v);
0262     ptstats_v->SetParent(val_hist1[nh1]->GetListOfFunctions());
0263       }
0264       
0265       //Create legend
0266       leg = new TLegend(0.50, 0.91, 0.84, 0.99, "","brNDC");
0267       leg->SetBorderSize(2);
0268       leg->SetFillStyle(1001); //
0269       leg->AddEntry(ref_hist1[nh1],"CMSSW_"+ref_vers,"l");
0270       leg->AddEntry(val_hist1[nh1],"CMSSW_"+val_vers,"l");
0271       
0272       leg->Draw();   
0273       
0274       myc->SaveAs(OutLabel);
0275       
0276       nh1++;
0277     }
0278 
0279     else if (DimSwitch == "2D"){
0280       //Get histograms from files
0281       ref_file.cd(RefHistDir);   
0282       ref_hist2[nh2] = (TH2F*) gDirectory->Get(HistName);
0283 
0284       ref_hist2[nh2]->SetMarkerStyle(21);     
0285       ref_hist2[nh2]->SetMarkerSize(0.02);     
0286 
0287       val_file.cd(ValHistDir);   
0288       val_hist2[nh2] = (TH2F*) gDirectory->Get(HistName);
0289 
0290       val_hist2[nh2]->SetMarkerStyle(21);     
0291       val_hist2[nh2]->SetMarkerSize(0.02);     
0292 
0293 
0294 
0295       // HACK to change what is embedded in DQM histos
0296       ref_hist2[nh2]->GetXaxis()->SetLabelSize(0.04); 
0297       val_hist2[nh2]->GetXaxis()->SetLabelSize(0.04); 
0298       ref_hist2[nh2]->GetYaxis()->SetLabelSize(0.04); 
0299       val_hist2[nh2]->GetYaxis()->SetLabelSize(0.04); 
0300       ref_hist2[nh2]->GetXaxis()->SetTitleSize(0.045); 
0301       val_hist2[nh2]->GetXaxis()->SetTitleSize(0.045); 
0302 
0303       ref_hist2[nh2]->GetXaxis()->SetTickLength(-0.015);
0304       val_hist2[nh2]->GetXaxis()->SetTickLength(-0.015);      
0305       ref_hist2[nh2]->GetYaxis()->SetTickLength(-0.015);
0306       val_hist2[nh2]->GetYaxis()->SetTickLength(-0.015);
0307       
0308       ref_hist2[nh2]->GetXaxis()->SetLabelOffset(0.02);
0309       val_hist2[nh2]->GetXaxis()->SetLabelOffset(0.02);
0310       ref_hist2[nh2]->GetYaxis()->SetLabelOffset(0.02);
0311       val_hist2[nh2]->GetYaxis()->SetLabelOffset(0.02);
0312 
0313       ref_hist2[nh2]->GetXaxis()->SetTitleOffset(1.0); 
0314       val_hist2[nh2]->GetXaxis()->SetTitleOffset(1.0); 
0315 
0316 
0317 
0318       //Set the colors, styles, titles, stat boxes and format x-axis for the histograms 
0319       if (StatSwitch == "Stat") ref_hist2[nh2]->SetStats(kTRUE);
0320       
0321       //Min/Max Convetion: Default AxisMin = 0. Default AxisMax = -1.
0322       //xAxis
0323       if (xAxisMin == 0) xAxisMin = ref_hist2[nh2]->GetXaxis()->GetXmin();
0324       if (xAxisMax <  0) xAxisMax = ref_hist2[nh2]->GetXaxis()->GetXmax();
0325       
0326       if (xAxisMax > 0 || xAxisMin != 0){
0327     ref_hist2[nh2]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0328     val_hist2[nh2]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0329       }
0330       //yAxis
0331       if (yAxisMin != 0) ref_hist2[nh2]->SetMinimum(yAxisMin);   
0332       if (yAxisMax  > 0) ref_hist2[nh2]->SetMaximum(yAxisMax);
0333       else if (ref_hist2[nh2]->GetMaximum() < val_hist2[nh2]->GetMaximum() &&
0334            val_hist2[nh2]->GetMaximum() > 0){
0335     if (LogSwitch == "Log") ref_hist2[nh2]->SetMaximum(   2 * val_hist2[nh2]->GetMaximum());
0336     else                    ref_hist2[nh2]->SetMaximum(1.05 * val_hist2[nh2]->GetMaximum());
0337       }
0338       
0339       //Legend
0340       leg = new TLegend(0.50, 0.91, 0.84, 0.99, "","brNDC");
0341       leg->SetBorderSize(2);
0342       leg->SetFillStyle(1001); 
0343 
0344       //Title
0345       ref_hist2[nh2]->GetXaxis()->SetTitle(xAxisTitle);
0346       ref_hist2[nh2]->SetStats(kFALSE);
0347       
0348       ref_hist2[nh2]->SetMarkerColor(RefCol); // rose
0349       ref_hist2[nh2]->Draw();
0350       
0351       val_hist2[nh2]->SetMarkerColor(ValCol); 
0352       val_hist2[nh2]->Draw("same");
0353       
0354       leg->AddEntry(ref_hist2[nh2],"CMSSW_"+ref_vers,"pl");
0355       leg->AddEntry(val_hist2[nh2],"CMSSW_"+val_vers,"pl");          
0356       
0357       leg->Draw("");
0358       
0359       myc->SaveAs(OutLabel);
0360       
0361       nh2++;
0362     }
0363     //Timing Histograms (special: read two lines at once)
0364     else if (DimSwitch == "TM"){
0365       
0366       ctstr>>HistName2;
0367 
0368       ref_file.cd(RefHistDir);   
0369       
0370       ref_hist2[nh2] = (TH2F*) gDirectory->Get(HistName);
0371       ref_prof[npi]  = (TProfile*) gDirectory->Get(HistName2);
0372 
0373       ref_hist2[nh2]->SetMarkerStyle(21);     
0374       ref_prof[npi] ->SetMarkerStyle(21);
0375       ref_hist2[nh2]->SetMarkerSize(0.02);     
0376       ref_prof[npi] ->SetMarkerSize(0.02);
0377 
0378       
0379       val_file.cd(ValHistDir);   
0380       
0381       val_hist2[nh2] = (TH2F*) gDirectory->Get(HistName);
0382       val_prof[npi]  = (TProfile*) gDirectory->Get(HistName2);
0383 
0384       val_hist2[nh2]->SetMarkerStyle(21);     
0385       val_prof[npi] ->SetMarkerStyle(21);
0386       val_hist2[nh2]->SetMarkerSize(0.02);     
0387       val_prof[npi] ->SetMarkerSize(0.02);
0388 
0389 
0390       // HACK to change what is embedded in DQM histos
0391       ref_hist2[nh2]->GetXaxis()->SetLabelSize(0.04); 
0392       val_hist2[nh2]->GetXaxis()->SetLabelSize(0.04); 
0393       ref_hist2[nh2]->GetYaxis()->SetLabelSize(0.04); 
0394       val_hist2[nh2]->GetYaxis()->SetLabelSize(0.04); 
0395       ref_hist2[nh2]->GetXaxis()->SetTitleSize(0.045); 
0396       val_hist2[nh2]->GetXaxis()->SetTitleSize(0.045); 
0397 
0398       ref_hist2[nh2]->GetXaxis()->SetTickLength(-0.015);
0399       val_hist2[nh2]->GetXaxis()->SetTickLength(-0.015);      
0400       ref_hist2[nh2]->GetYaxis()->SetTickLength(-0.015);
0401       val_hist2[nh2]->GetYaxis()->SetTickLength(-0.015);
0402       
0403       ref_hist2[nh2]->GetXaxis()->SetLabelOffset(0.02);
0404       val_hist2[nh2]->GetXaxis()->SetLabelOffset(0.02);
0405       ref_hist2[nh2]->GetYaxis()->SetLabelOffset(0.02);
0406       val_hist2[nh2]->GetYaxis()->SetLabelOffset(0.02);
0407 
0408       ref_hist2[nh2]->GetXaxis()->SetTitleOffset(1.0); 
0409       val_hist2[nh2]->GetXaxis()->SetTitleOffset(1.0); 
0410 
0411 
0412       //Min/Max Convetion: Default AxisMin = 0. Default AxisMax = -1.
0413       //xAxis
0414       if (xAxisMin == 0) xAxisMin = ref_hist2[nh2]->GetXaxis()->GetXmin();
0415       if (xAxisMax <  0) xAxisMax = ref_hist2[nh2]->GetXaxis()->GetXmax();
0416 
0417       if (xAxisMax > 0 || xAxisMin != 0){
0418     ref_hist2[nh2]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0419     val_hist2[nh2]->GetXaxis()->SetRangeUser(xAxisMin,xAxisMax);
0420       }
0421       //yAxis
0422       if (yAxisMin != 0) ref_hist2[nh2]->SetMinimum(yAxisMin);   
0423       if (yAxisMax  > 0) ref_hist2[nh2]->SetMaximum(yAxisMax);  
0424       else if (ref_hist2[nh2]->GetMaximum() < val_hist2[nh2]->GetMaximum() &&
0425            val_hist2[nh2]->GetMaximum() > 0){
0426     if (LogSwitch == "Log") ref_hist2[nh2]->SetMaximum(   2 * val_hist2[nh2]->GetMaximum());
0427     else                    ref_hist2[nh2]->SetMaximum(1.05 * val_hist2[nh2]->GetMaximum());
0428       }
0429 
0430       //Legend
0431       leg = new TLegend(0.50, 0.91, 0.84, 0.99, "","brNDC");
0432       leg->SetBorderSize(2);
0433       leg->SetFillStyle(1001); 
0434       
0435       ref_hist2[nh2]->GetXaxis()->SetTitle(xAxisTitle);
0436       ref_hist2[nh2]->SetStats(kFALSE);
0437      
0438       ref_hist2[nh2]->SetTitle("");
0439       val_prof[npi]->SetTitle("");
0440 
0441       ref_hist2[nh2]->SetMarkerColor(RefCol); // rose
0442       ref_hist2[nh2]->Draw();
0443       ref_prof[npi]->SetLineColor(RefCol); 
0444       ref_prof[npi]->Draw("same");
0445       
0446       val_hist2[nh2]->SetMarkerColor(ValCol); 
0447       val_hist2[nh2]->Draw("same");
0448       val_prof[npi]->SetLineColor(867); 
0449       val_prof[npi]->Draw("same");
0450       
0451       leg->AddEntry(ref_prof[npi],"CMSSW_"+ref_vers,"pl");
0452       leg->AddEntry(val_prof[npi],"CMSSW_"+val_vers,"pl");           
0453       
0454       leg->Draw("");
0455       
0456       myc->SaveAs(OutLabel);    
0457 
0458       npi++;
0459       nh2++;
0460       i++;
0461     }
0462 
0463 
0464     if(leg) delete leg;
0465     if(ptchi2) delete ptchi2;
0466     if(ptstats_r) delete ptstats_r;
0467     if(ptstats_v) delete ptstats_v;
0468   }
0469   if(myc) delete myc;
0470   return;
0471 }